Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-05-03 13:08:32 +0200
committerErich Eckner <git@eckner.net>2017-05-03 20:52:59 +0200
commit3ae97f07be56a2669279ae6c5b0efe403d3ba313 (patch)
tree4273c9ef70b78fd3d678352ff9440b80d1cd918a /bin/get-package-updates
parentc0760a0fe81db0b7f8ad37c36b702fad94687dbc (diff)
breaking of loops optimized
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index ac7e905..f6aef31 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -196,11 +196,23 @@ echo 'Now actually sort it.'
awk '{print $4 " " $6 " " $7}' > \
"${work_dir}/build-list.new.new"
+rm -f "${work_dir}/build-order.loops/*"
+
if [ -s "${work_dir}/tsort.error" ]; then
>&2 echo 'WARNING: There is a dependency cycle!'
>&2 cat "${work_dir}/tsort.error"
>&2 echo
>&2 echo 'I will continue anyway.'
+ # save loops in separate files each, so breaking them is easier
+ awk '
+ /^tsort: \S+: input contains a loop:$/{
+ n++;
+ getline
+ }
+ {
+ print $2 >"'"${work_dir}"'/build-list.loops/loop_" n
+ }
+ ' "${work_dir}/tsort.error"
else
rm "${work_dir}/tsort.error"
fi