From c688e26074797c6145b81f7482ef5c98066678e0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 10 Jan 2018 10:20:22 +0100 Subject: bin/return-assignment: automagically reschedule broken haskell-* packages --- bin/return-assignment | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bin/return-assignment') 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 -- cgit v1.2.3-70-g09d2