From 3ae97f07be56a2669279ae6c5b0efe403d3ba313 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 3 May 2017 13:08:32 +0200 Subject: breaking of loops optimized --- bin/get-package-updates | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin/get-package-updates') 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 -- cgit v1.2.3-70-g09d2