Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/sanity-check
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-23 21:35:06 +0200
committerErich Eckner <git@eckner.net>2017-08-23 21:35:06 +0200
commit395c60b1ce1c8bc84746ecfefba21d3234b288fa (patch)
tree7b5ef1ec650e6948714c358ba8338fcc75a4567f /bin/sanity-check
parentd44c45606f6289889cb0f5c12ab5bed61d65330d (diff)
silence a lot shellcheck warnings
Diffstat (limited to 'bin/sanity-check')
-rwxr-xr-xbin/sanity-check12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/sanity-check b/bin/sanity-check
index a61f3aa..6ce0565 100755
--- a/bin/sanity-check
+++ b/bin/sanity-check
@@ -2,6 +2,7 @@
# do some basic sanity checks
+# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"
usage() {
@@ -12,7 +13,7 @@ usage() {
>&2 echo ' -h|--help: Show this help and exit.'
>&2 echo ' -q|--quiet: Only print errors found.'
>&2 echo ' -r|--really-quiet: Do not print anything.'
- [ -z "$1" ] && exit 1 || exit $1
+ [ -z "$1" ] && exit 1 || exit "$1"
}
i_am_insane() {
@@ -130,6 +131,7 @@ while [ $# -gt 0 ]; do
errors=$(
(
+ # shellcheck disable=SC2086
printf 'expected %s\n' ${repos}
ls_master_mirror 'i686' | \
sed 's|^|found |'
@@ -245,7 +247,7 @@ while [ $# -gt 0 ]; do
i_am_insane
fi
- rm -rf --one-file-system "${tmp_dir}/"*
+ rm -rf --one-file-system "${tmp_dir:?}/"*
[ ${silence} -gt 0 ] || \
>&2 echo ' passed.'
@@ -263,10 +265,8 @@ while [ $# -gt 0 ]; do
errors=$(
(
- ls "${work_dir}/package-states" | \
- grep "\.${status#*:}\$" | \
- sed "s|^|${work_dir}/package-states/|" | \
- xargs -r cat | \
+ find "${work_dir}/package-states" -name "*.${status#*:}" -exec \
+ cat {} \; | \
sed 's|^|package-state-file |'
ls_master_mirror 'i686' | \
grep "${status%:*}\$" | \