#!/bin/sh # check archlinux' bug tracker for open bugs on packages that fail to build # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" tmp_dir=$(mktemp -d 'tmp.check-upstream-bug-tracker.XXXXXXXXXX' --tmpdir) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT >&2 printf 'receiving upstream bugs of broken packages ' # shellcheck disable=SC2016 { printf 'SELECT DISTINCT' printf '`package_sources`.`%s`,' \ 'pkgbase' \ 'git_revision' \ 'mod_git_revision' printf '`upstream_repositories`.`name`' printf ' FROM `package_sources`' mysql_join_package_sources_upstream_repositories mysql_join_package_sources_build_assignments mysql_join_build_assignments_binary_packages mysql_join_binary_packages_binary_packages_in_repositories printf ' WHERE `binary_packages_in_repositories`.`repository`=%s' \ "${repository_ids__any_build_list}" printf ' AND `build_assignments`.`is_broken`' printf ' AND `build_assignments`.`is_blocked` IS NULL;\n' } | \ mysql_run_query 'unimportant' | \ while read -r pkgbase git_revision mod_git_revision repository; do >&2 printf '.' curl -Ssg 'https://bugs.archlinux.org/index.php?string=['"${pkgbase}"']&project=5&status[]=open' | \ sed -n ' s@^.*