Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check-bugtracker34
-rwxr-xr-xbin/modify-package-state22
2 files changed, 54 insertions, 2 deletions
diff --git a/bin/check-bugtracker b/bin/check-bugtracker
new file mode 100755
index 0000000..f01bc8e
--- /dev/null
+++ b/bin/check-bugtracker
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# check the bug tracker for packages in testing and community-testing
+# with issues and mark these packages as "testing" if they are currently
+# marked as "tested"
+
+# shellcheck disable=SC2039
+# shellcheck source=conf/default.conf
+. "${0%/*}/../conf/default.conf"
+
+tmp_dir=$(mktemp -d)
+trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
+
+receive_buglist | \
+ grep '<\(community-\)\?testing>' | \
+ tr ' ,;' '\n' | \
+ sed -n '
+ s/^\[//
+ T
+ s/]$//
+ T
+ p
+ ' | \
+ sort -u > \
+ "${tmp_dir}/faulty-packages"
+
+find "${work_dir}/package-states" -name '*.tested' -printf '%f\n' | \
+ sed '
+ s|\.[^.]\+$||
+ s|^\(.*\)\(\.[^.]\+\)\{3\}$|\1 \0|
+ ' | \
+ sort -k1,1 | \
+ join -1 1 -2 1 -o 1.2 - "${tmp_dir}/faulty-packages" | \
+ "${base_dir}/bin/modify-package-state" -n --faulty /dev/stdin
diff --git a/bin/modify-package-state b/bin/modify-package-state
index 2640aa2..6ccec6a 100755
--- a/bin/modify-package-state
+++ b/bin/modify-package-state
@@ -11,6 +11,7 @@ usage() {
>&2 echo ''
>&2 echo 'possible options:'
>&2 echo ' -b|--block: Block package(s).'
+ >&2 echo ' -f|--faulty: Mark testing/tested package(s) as faulty.'
>&2 echo ' -h|--help: Show this help and exit.'
>&2 echo ' -n|--no-report: Do not report what packages were modified.'
>&2 echo ' -t|--tested: Mark package(s) as tested.'
@@ -21,8 +22,9 @@ usage() {
}
eval set -- "$(
- getopt -o bhntu \
+ getopt -o bfhntu \
--long block \
+ --long faulty \
--long help \
--long no-report \
--long tested \
@@ -44,6 +46,13 @@ do
fi
action='block'
;;
+ -f|--faulty)
+ if [ -n "${action}" ]; then
+ >&2 echo 'Conflicting/redundand arguments.'
+ usage
+ fi
+ action='faulty'
+ ;;
-h|--help)
usage 0
;;
@@ -77,7 +86,7 @@ do
done
if [ -z "${action}" ]; then
- >&2 echo 'Expected -b|-t|-u.'
+ >&2 echo 'Expected -b|-f|-t|-u.'
usage
fi
@@ -167,12 +176,21 @@ fi
printf '%s %s\n' "${package}" "${reason}"
fi
;;
+ 'faulty')
+ if [ -f "${work_dir}/package-states/${package}.tested" ]; then
+ mv \
+ "${work_dir}/package-states/${package}.tested" \
+ "${work_dir}/package-states/${package}.testing"
+ printf '%s\n' "${package}"
+ fi
+ ;;
'tested')
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"
+ printf '%s\n' "${package}"
fi
;;
'unblock')