From fdad904f54182d086e9b1ff113ea582d2cce60a2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 8 Nov 2017 09:39:41 +0100 Subject: bin/show-dependencies: also collapse knots in ALL-build-list.png --- bin/show-dependencies | 82 +++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 42 deletions(-) (limited to 'bin/show-dependencies') 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\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| - 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\2@ + s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1\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| + 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 | \ -- cgit v1.2.3-70-g09d2