From c7895f146cc68a5e66a834d65d89bdef45326b63 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 May 2017 08:50:03 +0200 Subject: bin/return-assignment: get info about broken loops from loops file rather than package lock files --- bin/return-assignment | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/return-assignment b/bin/return-assignment index 53708a7..bcba543 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -41,21 +41,24 @@ if [ "$5" == 'ERROR' ]; then # unlock every loop this package would have broken and which is not # broken by another locked package - ( - # loops broken by another locked package - ls "${work_dir}/package-states/" | \ - grep '\.locked$' | \ - sed 's|\.locked$||' | \ - xargs -n1 sed '1d' | \ - sort -u | \ - sed 'p' - # loops broken by this package - sed '1d' "${work_dir}/package-states/$1.$2.$3.$4.broken" - ) | \ - sort | \ - uniq -u | \ - sed 's|$|.locked|' | \ - xargs -rn1 rm -f + locked_packages="$( + ls "${work_dir}/package-states/"*".locked" | \ + sed 's@^.*/\([^/]\+\)\.\([0-9a-f]\{40\}\.\)\{2\}[^.]\+\.locked$@\1@' + )" + grep "^${1//./\\.}\$" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \ + cut -d: -f1 | \ + while read -r loop; do + if [ -z "$( + ( + echo "${locked_packages}" + cat "${loop}" + ) | \ + sort | \ + uniq -d + )" ]; then + rm -f "${loop}.locked" + fi + done exit 0 -- cgit v1.2.3-70-g09d2