Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/show-dependencies
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-23 22:07:00 +0200
committerErich Eckner <git@eckner.net>2017-08-23 22:07:00 +0200
commit67ffb502ea0c2bbf36dbfc0c8dfcd065002aabd8 (patch)
tree44ebe3ab863d236e052440f5ca72361316494971 /bin/show-dependencies
parent1061c920833a562e02584aa70e7c889a734139d8 (diff)
silence all other shellcheck warnings
Diffstat (limited to 'bin/show-dependencies')
-rwxr-xr-xbin/show-dependencies25
1 files changed, 12 insertions, 13 deletions
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 | \