index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2017-05-22 08:50:03 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-05-22 08:50:03 +0200 |
commit | c7895f146cc68a5e66a834d65d89bdef45326b63 (patch) | |
tree | e634fc42a4421d12c01f1ce881053d9ad3b0841b /bin | |
parent | 6d2d5420fdf4949da8822ae71e35e13107ac48e2 (diff) |
-rwxr-xr-x | bin/return-assignment | 33 |
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 |