summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-11 10:09:50 +0100
committerErich Eckner <git@eckner.net>2018-01-11 10:09:50 +0100
commit8e85f1e4f02ff09d55b8fd107ba96a3c2036c41b (patch)
tree435950719d0bd2cdd488899ebcd096a8488f63b4 /bin/return-assignment
parent02fb70ff1a82886f9e22dcb3790d4ea585e36f0b (diff)
downloadbuilder-8e85f1e4f02ff09d55b8fd107ba96a3c2036c41b.tar.xz
bin/return-assignment: only reschedule haskell-* packages if the reporting package is broken the first time. Also report to irc about rescheduling
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment72
1 files changed, 42 insertions, 30 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 5b26ef6..b9bc117 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -109,37 +109,49 @@ if [ "$5" = 'ERROR' ]; then
# release lock on build-list - otherwise seed-build-list won't run
flock -u 9
- haskell_rebuild_packages=$(
- find "${build_log_directory}/error" -type f \
- -name "$1.$2.$3.$4.*.build-log.gz" \
- -exec zgrep -qFx ' The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.' {} \; \
- -exec zcat {} \; | \
- sed -n '
- s/^installed package \(.*\) is broken due to missing package .*$/\1/
- T
- p
- ' | \
- tr ' ' '\n' | \
- sed '
- s/^/-p ^haskell-/
- s/-[0-9.]\+$/\$/
- ' | \
- sort -u
- )
- if [ -n "${haskell_rebuild_packages}" ]; then
- # shellcheck disable=SC2086
- if [ -n "$("${base_dir}/bin/seed-build-list" ${haskell_rebuild_packages})" ]; then
- # something was rescheduled, so we don't want to say it on the irc channel
- was_broken_before=false
- fi
- fi
+ if ! ${was_broken_before}; then
+
+ haskell_rebuild_packages=$(
+ find "${build_log_directory}/error" -type f \
+ -name "$1.$2.$3.$4.*.build-log.gz" \
+ -exec zgrep -qFx ' The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.' {} \; \
+ -exec zcat {} \; | \
+ sed -n '
+ s/^installed package \(.*\) is broken due to missing package .*$/\1/
+ T
+ p
+ ' | \
+ tr ' ' '\n' | \
+ sed '
+ s/^/-p ^haskell-/
+ s/-[0-9.]\+$/\$/
+ ' | \
+ sort -u
+ )
+
+ rescheduled_packages=$(
+ if [ -n "${haskell_rebuild_packages}" ]; then
+ # shellcheck disable=SC2086
+ "${base_dir}/bin/seed-build-list" ${haskell_rebuild_packages} | \
+ sed 's/\(\.[^.]\+\)\{3\}$//'
+ fi
+ )
- if ! ${was_broken_before} && \
- [ -p "${irc_dir}/#archlinux-ports/in" ]; then
- printf '%s is broken (says %s).\n' \
- "$1" \
- "${slave}" > \
- "${irc_dir}/#archlinux-ports/in"
+ if [ -p "${irc_dir}/#archlinux-ports/in" ]; then
+ {
+ printf '%s is broken (says %s).' \
+ "$1" \
+ "${slave}"
+ if [ -n "${rescheduled_packages}" ]; then
+ printf ' - I rescheduled:'
+ # shellcheck disable=SC2086
+ printf ' %s,' ${rescheduled_packages} | \
+ sed 's/,$/./'
+ fi
+ printf '\n'
+ } > \
+ "${irc_dir}/#archlinux-ports/in"
+ fi
fi
exit 0