summaryrefslogtreecommitdiff
path: root/bin/show-dependencies
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-11-08 09:39:41 +0100
committerErich Eckner <git@eckner.net>2017-11-08 09:39:41 +0100
commitfdad904f54182d086e9b1ff113ea582d2cce60a2 (patch)
treed70ad7bb79f4118cdfc3dd3993508ddb86dcd1bb /bin/show-dependencies
parent92a958f5744fe8723339d6705c2f8cc7f7c36acd (diff)
downloadbuilder-fdad904f54182d086e9b1ff113ea582d2cce60a2.tar.xz
bin/show-dependencies: also collapse knots in ALL-build-list.png
Diffstat (limited to 'bin/show-dependencies')
-rwxr-xr-xbin/show-dependencies82
1 files changed, 40 insertions, 42 deletions
diff --git a/bin/show-dependencies b/bin/show-dependencies
index 65aca79..58a0241 100755
--- a/bin/show-dependencies
+++ b/bin/show-dependencies
@@ -303,50 +303,48 @@ for target_package in "$@"; do
sort -k2,3 | \
sponge "${tmp_dir}/knots"
- if [ "${target_package}" != 'ALL-build-list' ]; then
-
- mkdir "${tmp_dir}/neighbours"
- cat "${tmp_dir}/knots" "${tmp_dir}/build-order" | \
- awk '{
- print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$1;
- print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$2;
- }'
-
- find "${tmp_dir}/neighbours" -maxdepth 1 -type f | \
- while read -r file; do
- sed "
- s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1<knot>\2@
- " "${file}" | \
- sort -u | \
- sponge "${file}"
- done
-
- find "${tmp_dir}/neighbours" -maxdepth 1 -type f -exec \
- sha512sum {} \; | \
- sed 's|^\(\S\+\) .*/\([^/]\+\)$|\2 \1|' | \
- sort -k2,2 | \
- uniq -f1 -D | \
- awk '{print $2 " " $1}' > \
- "${tmp_dir}/sums"
-
- rm -rf --one-file-system "${tmp_dir}/neighbours"
-
- sed '
- :a
- $!N
- s|^\(\S\+\) \([^\n]\+\)\n\1 |\1 \2<nl>|
- ta
- P
- D
- ' "${tmp_dir}/sums" | \
- join -1 1 -2 1 -o 2.2,1.2 - "${tmp_dir}/sums" | \
- while read -r original replacement; do
- sed -i "
- s@\( \|^\)$(str_to_regex "${original}")\( \|\$\)@\1${replacement}\2@
- " "${tmp_dir}/build-order" "${tmp_dir}/knots"
+ mkdir "${tmp_dir}/neighbours"
+ cat "${tmp_dir}/knots" "${tmp_dir}/build-order" | \
+ awk '{
+ print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$1;
+ print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$2;
+ }'
+
+ find "${tmp_dir}/neighbours" -maxdepth 1 -type f | \
+ while read -r file; do
+ sed "
+ s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1<knot>\2@
+ s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1<knot>\2@
+ " "${file}" | \
+ sort -u | \
+ sponge "${file}"
done
- fi
+ find "${tmp_dir}/neighbours" -maxdepth 1 -type f -exec \
+ sha512sum {} \; | \
+ sed 's|^\(\S\+\) .*/\([^/]\+\)$|\2 \1|' | \
+ sort -k2,2 | \
+ uniq -f1 -D | \
+ awk '{print $2 " " $1}' > \
+ "${tmp_dir}/sums"
+
+ rm -rf --one-file-system "${tmp_dir}/neighbours"
+
+ sed '
+ :a
+ $!N
+ s|^\(\S\+\) \([^\n]\+\)\n\1 |\1 \2<nl>|
+ ta
+ P
+ D
+ ' "${tmp_dir}/sums" | \
+ join -1 1 -2 1 -o 2.2,1.2 - "${tmp_dir}/sums" | \
+ while read -r original replacement; do
+ sed -i "
+ s@\( \|^\)$(str_to_regex "${original}")\( \|\$\)@\1${replacement}\2@
+ s@\( \|^\)$(str_to_regex "${original}")\( \|\$\)@\1${replacement}\2@
+ " "${tmp_dir}/build-order" "${tmp_dir}/knots"
+ done
grep -v '^\(\S\+\) \1$' "${tmp_dir}/build-order" | \
sort -u | \