index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/show-dependencies | 25 |
diff --git a/bin/show-dependencies b/bin/show-dependencies index f6110d3..fc381dd 100755 --- a/bin/show-dependencies +++ b/bin/show-dependencies @@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then sum='' tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT - find "${work_dir}/package-infos" -name '*.builds' -exec \ + find "${work_dir}/package-infos" -maxdepth 1 -name '*.builds' -exec \ grep -HF '' {} \; | \ sed ' s|^.*/|| @@ -68,7 +68,7 @@ if [ $# -eq 0 ]; then # shellcheck disable=SC2086 printf '%s\n' ${broken} ( - ls "${webserver_directory}/graphs" | \ + find "${webserver_directory}/graphs" -maxdepth 1 -name '*.png' -printf '%f\n' | \ sed 's|\.png$||' ( awk '{print $1}' < \ @@ -85,13 +85,12 @@ if [ $# -eq 0 ]; then # shellcheck disable=SC2086 "$0" 'ALL' ${broken} ( - ls "${webserver_directory}/graphs" + find "${webserver_directory}/graphs" -maxdepth 1 -name '*.png' # shellcheck disable=SC2086 - printf '%s.png\n' ${broken} ${broken} 'ALL' 'ALL' + printf "${webserver_directory}"'/graphs/%s.png\n' ${broken} ${broken} 'ALL' 'ALL' ) | \ sort | \ uniq -u | \ - sed "s|^|${webserver_directory}/graphs/|" | \ xargs -r rm exit fi @@ -135,7 +134,7 @@ sort -k1,1 "${work_dir}/build-list" > \ sort -u | \ sponge "${tmp_dir}/original-build-order" -ls "${work_dir}/package-infos" | \ +find "${work_dir}/package-infos" -maxdepth 1 -printf '%f\n' | \ sed 's|\(\.[^.]\+\)\{4\}$||' | \ sort -u > \ "${tmp_dir}/known-packages" @@ -228,6 +227,7 @@ for target_package in "$@"; do grep -v '^\(\S\+\) \1$' "${tmp_dir}/build-order" | \ sponge "${tmp_dir}/build-order" + # shellcheck disable=SC2129 tr ' ' '\n' < \ "${tmp_dir}/build-order" | \ sort -u | \ @@ -308,18 +308,17 @@ for target_package in "$@"; do print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$2; }' - ls "${tmp_dir}/neighbours" | \ + find "${tmp_dir}/neighbours" -maxdepth 1 -type f | \ while read -r file; do sed " - s@\(^\| \)$(str_to_regex "${file}")\( \|\$\)@\1<knot>\2@ - " "${tmp_dir}/neighbours/${file}" | \ + s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1<knot>\2@ + " "${file}" | \ sort -u | \ - sponge "${tmp_dir}/neighbours/${file}" + sponge "${file}" done - ls "${tmp_dir}/neighbours" | \ - sed "s|^|${tmp_dir}/neighbours/|" | \ - xargs -r sha512sum | \ + find "${tmp_dir}/neighbours" -maxdepth 1 -type f -exec \ + sha512sum {} \; | \ sed 's|^\(\S\+\) .*/\([^/]\+\)$|\2 \1|' | \ sort -k2,2 | \ uniq -f1 -D | \ |