summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-07 16:27:43 +0200
committerErich Eckner <git@eckner.net>2017-08-07 16:27:43 +0200
commite8726cd5c3c0675635946cbd526dc0015c911e47 (patch)
treeffc9550e0de39aa921a78c1cdf0add7dd9cfa22b
parent63e66a8cc4e5af29cc9d7233b8034276b9e338a3 (diff)
downloadbuilder-e8726cd5c3c0675635946cbd526dc0015c911e47.tar.xz
bin/show-dependencies: also generate dependency graphs for all dependencies of broken packages on the build list
-rwxr-xr-xbin/show-dependencies63
1 files changed, 60 insertions, 3 deletions
diff --git a/bin/show-dependencies b/bin/show-dependencies
index c0f298a..e475acc 100755
--- a/bin/show-dependencies
+++ b/bin/show-dependencies
@@ -6,10 +6,67 @@
if [ $# -eq 0 ]; then
broken=$(
+ ls "${work_dir}/package-states" | \
+ grep '\.broken$' | \
+ sed 's|\(\.[^.]\+\)\{4\}$||' | \
+ sort -u
+ )
+ new_sum='x'
+ sum=''
+ tmp_dir=$(mktemp -d)
+ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
+ ls "${work_dir}/package-infos" | \
+ grep '\.builds$' | \
+ sed "s|^|${work_dir}/package-infos/|" | \
+ xargs grep -HF '' | \
+ sed '
+ s|^.*/||
+ s|\(\.[^.]\+\)\{4\}:| |
+ ' | \
+ sort -k2,2 > \
+ "${tmp_dir}/builds"
+ while ! [ "${new_sum}" = "${sum}" ]; do
+ sum="${new_sum}"
+ printf '%s\n' ${broken} | \
+ sort > \
+ "${tmp_dir}/broken"
+ broken=$(
+ (
+ ls "${work_dir}/package-infos" | \
+ grep '\.depends$' | \
+ sed 's|^\(.*\)\(\.[^.]\+\)\{4\}|\1 \0|' | \
+ sort -k1,1 | \
+ join -1 1 -2 1 -o 1.2 - "${tmp_dir}/broken" | \
+ sed "s|^|${work_dir}/package-infos/|" | \
+ xargs -r cat
+ ) | \
+ sort -u | \
+ join -1 1 -2 2 -o 2.1 - "${tmp_dir}/builds"
+ )
+ broken=$(
+ (
+ (
+ printf '%s\n' ${broken}
+ cat "${tmp_dir}/broken"
+ ) | \
+ sort -u
+ awk '{print $1}' "${work_dir}/build-list" | \
+ sort -u
+ ) | \
+ sort | \
+ uniq -d
+ )
+ new_sum=$(
+ printf '%s\n' ${broken} | \
+ sha512sum
+ )
+ done
+
+ rm -rf --one-file-system "${tmp_dir}"
+ trap - EXIT
+ broken=$(
(
- ls "${work_dir}/package-states" | \
- grep '\.broken$' | \
- sed 's|\(\.[^.]\+\)\{4\}$||'
+ printf '%s\n' ${broken}
(
ls "${webserver_directory}/graphs" | \
sed 's|\.png$||'