Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-01 09:41:09 +0100
committerErich Eckner <git@eckner.net>2017-11-01 09:41:09 +0100
commit4e67e6d62a91cba3f2f54401bba073b601db82d5 (patch)
tree395b27253aa5f6965adc7da81f57c902ccb0ab73 /bin/return-assignment
parent5fe9ee97e9800b982854e3212107f7d50e0b6aa9 (diff)
bin/return-assignment: cleanup
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment27
1 files changed, 7 insertions, 20 deletions
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"