diff options
author | Erich Eckner <git@eckner.net> | 2017-11-07 09:27:50 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-11-07 09:27:50 +0100 |
commit | b06968ce11c6afe27fe949fef864ea41ff95579d (patch) | |
tree | 74947654501ba42cf975089f8be4e606f8ba1897 | |
parent | 354695aee30a3b124c8ae2bf59c60481159012a7 (diff) | |
download | builder-b06968ce11c6afe27fe949fef864ea41ff95579d.tar.xz |
bin/common-functions, bin/modify-package-state: check bugtracker if package has issue before marking as "tested"
-rwxr-xr-x | bin/common-functions | 28 | ||||
-rwxr-xr-x | bin/modify-package-state | 20 |
2 files changed, 43 insertions, 5 deletions
diff --git a/bin/common-functions b/bin/common-functions index 81d4e8f..bf88b8f 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -608,7 +608,9 @@ wait_some_time() { str_to_regex() { echo "$1" | \ - sed 's|\.|\\.|g' + sed ' + s|[.[]|\\\0|g + ' } # make_source_info $package $repository $git_revision $mod_git_revision $output @@ -1174,3 +1176,27 @@ print_list_of_archaic_packages() { done | \ sort -u } + +# receive_buglist +# receive the buglist from bugs.archlinux32.org and print it to stdout + +receive_buglist() { + curl -Ss 'http://bugs.archlinux32.org/index.php?export_list=Export%20Tasklist' | \ + sed ' + 1 d + /^[^,]\+,Packages,/ ! d + s/^\([^,]\+,\)\{3\}// + s/^"[^"]\+","// + s/".*$// + ' +} + +# package_has_bug ${package} +# check if there is an open bug report on ${package} in testing or community-testing +# the bug list is read from stdin + +package_has_bug() { + local package + package="$1" + grep -q "$(str_to_regex "[${package}]").*<\(community-\)\?testing>" +} diff --git a/bin/modify-package-state b/bin/modify-package-state index aba9296..b4c8157 100755 --- a/bin/modify-package-state +++ b/bin/modify-package-state @@ -86,6 +86,12 @@ if [ $# -ne 1 ]; then usage fi +clean_up() { + rm -rf --one-file-system "${tmp_dir}" +} +tmp_dir=$(mktemp -d) +trap clean_up EXIT + input_file="$1" if ${report}; then if ! [ -w "${input_file}" ]; then @@ -96,9 +102,10 @@ if ${report}; then fi move_output() { cat "${output_file}" > "${input_file}" - rm "${output_file}" + clean_up } - output_file=$(mktemp) + output_file="${tmp_dir}/output-file" + touch "${output_file}" trap 'move_output' EXIT else output_file='/dev/null' @@ -117,6 +124,11 @@ if ! flock -s -n 9; then exit fi +if [ "${action}" = 'tested' ]; then + receive_buglist > \ + "${tmp_dir}/package-bug-titles" +fi + { err=0 while read -r package reason; do @@ -158,8 +170,8 @@ fi fi ;; 'tested') - # TODO: check in bugtracker if package is faulty - if [ -f "${work_dir}/package-states/${package}.testing" ]; then + if [ -f "${work_dir}/package-states/${package}.testing" ] && \ + ! package_has_bug "${package}" < "${tmp_dir}/package-bug-titles"; then mv \ "${work_dir}/package-states/${package}.testing" \ "${work_dir}/package-states/${package}.tested" |