Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-10 10:20:22 +0100
committerErich Eckner <git@eckner.net>2018-01-10 10:20:22 +0100
commitc688e26074797c6145b81f7482ef5c98066678e0 (patch)
tree369eabc5e39ad4268e4ddd3301b9cda1f701bf7e
parente9e6b01cf53797f25f5ad4529b6fea0c32c0aa68 (diff)
bin/return-assignment: automagically reschedule broken haskell-* packages
-rwxr-xr-xbin/return-assignment25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index c26a71b..82543ae 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -108,6 +108,31 @@ if [ "$5" = 'ERROR' ]; then
"${work_dir}/build-list"
fi
+ # 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 ^/
+ s/-[0-9.]\+$/\$/
+ ' | \
+ sort -u
+ )
+ if [ -n "${haskell_rebuild_packages}" ]; then
+ # shellcheck disable=SC2086
+ seed-build-list ${haskell_rebuild_packages}
+ fi
+
exit 0
fi