diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-09-14 09:17:44 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-09-14 09:17:44 +0200 |
commit | 02f0b8cd4f34b5ce9b375eae70a010a975edd07b (patch) | |
tree | d7f003e0fd212c9f55ae16fc229a91293ed2046c | |
parent | 71aef281f16e384b9c8f7998cca37bdb6589341c (diff) | |
download | builder-02f0b8cd4f34b5ce9b375eae70a010a975edd07b.tar.xz |
check-upstream-bug-tracker: added -p option for specific package checks
-rwxr-xr-x | bin/check-upstream-bug-tracker | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/bin/check-upstream-bug-tracker b/bin/check-upstream-bug-tracker index 95b6239..a82cc88 100755 --- a/bin/check-upstream-bug-tracker +++ b/bin/check-upstream-bug-tracker @@ -14,20 +14,24 @@ usage() { >&2 echo ' only check packages which fail on $arch' >&2 echo ' -f|--failure $identifier:' >&2 echo ' only check packages which fail due to $identifier' + >&2 echo ' -p|--package $package:' + >&2 echo ' only check package $package (can be given multiple times)' >&2 echo ' -h|--help: Show this help and exit.' [ -z "$1" ] && exit 1 || exit "$1" } eval set -- "$( - getopt -o a:f:h \ + getopt -o a:f:p:h \ --long architecture: \ --long failure: \ + --long package: \ --long help \ -n "$(basename "$0")" -- "$@" || \ echo usage )" architecture='' identifier='' +packages='' while true do @@ -48,6 +52,10 @@ do fi identifier="$1" ;; + -p|--package) + shift + packages="$packages $1" + ;; -h|--help) usage 0 ;; @@ -108,18 +116,29 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT 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@^.*<td class='"'"'task_id'"'"'><a href="https://bugs\.archlinux\.org/task/\([0-9]\+\)?.*<td class='"'"'task_summary'"'"'><a href=[^>]\+>\(.*\)</a></td>.*$@\1\t\2@ - T - s/^/'"${pkgbase}.${git_revision}.${mod_git_revision}.${repository}"'\t/ - p - ' - done > \ - "${tmp_dir}/broken-packages" +mysql_run_query 'unimportant' \ +> "${tmp_dir}/broken-packages-candidates" + +# explicit package list overwrites select broken packages from database +if [ -n "${packages}" ]; then + for p in $packages; do + grep "$p" "${tmp_dir}/broken-packages-candidates" >> "${tmp_dir}/filtered-broken-packages-candidates" + done + mv "${tmp_dir}/filtered-broken-packages-candidates" "${tmp_dir}/broken-packages-candidates" +fi + +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@^.*<td class='"'"'task_id'"'"'><a href="https://bugs\.archlinux\.org/task/\([0-9]\+\)?.*<td class='"'"'task_summary'"'"'><a href=[^>]\+>\(.*\)</a></td>.*$@\1\t\2@ + T + s/^/'"${pkgbase}.${git_revision}.${mod_git_revision}.${repository}"'\t/ + p + ' +done > \ +"${tmp_dir}/broken-packages" \ +< "${tmp_dir}/broken-packages-candidates" >&2 printf ' done\n' |