From 4e67e6d62a91cba3f2f54401bba073b601db82d5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 1 Nov 2017 09:41:09 +0100 Subject: bin/return-assignment: cleanup --- bin/return-assignment | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index 6961507..9bb4b0c 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -79,23 +79,11 @@ if [ "$5" = 'ERROR' ]; then find "${work_dir}/package-states/" -maxdepth 1 -name '*.locked' -printf '%f\n' | \ sed 's@^\(.\+\)\.\([0-9a-f]\{40\}\.\)\{2\}[^.]\+\.locked$@\1@' ) - find "${work_dir}/build-list.loops" -maxdepth 1 \ - -name 'loop_*' \ - -not -name 'loop_*.locked' \ + find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' \ -exec grep -qxF "$1" '{}' \; \ - -print | \ - while read -r loop; do - if [ -z "$( - ( - echo "${locked_packages}" - cat "${loop}" - ) | \ - sort | \ - uniq -d - )" ]; then - rm -f "${loop}.locked" - fi - done + -not -exec grep -qxF "${locked_packages}" '{}' \; \ + -exec rm '{}.locked' \; # move build order to end of build list @@ -261,11 +249,10 @@ find "${work_dir}/package-states" -maxdepth 1 -regextype grep \ -exec rm '{}' \; # remove all loops which are broken by this package -find "${work_dir}/build-list.loops" -maxdepth 1 \ - -name 'loop_*' \ - -not -name 'loop_*.locked' \ +find "${work_dir}/build-list.loops" -maxdepth 1 -regextype grep \ + -regex '.*/loop_[0-9]\+' \ -exec grep -qxF "$1" '{}' \; \ - -exec rm '{}' '{}.locked' \; + -exec rm '{}.locked' \; # remove package from build list sed -i "/^$(str_to_regex "$1 $2 $3 $4")\$/d" "${work_dir}/build-list" -- cgit v1.2.3-70-g09d2