From 395c60b1ce1c8bc84746ecfefba21d3234b288fa Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 23 Aug 2017 21:35:06 +0200 Subject: silence a lot shellcheck warnings --- bin/sanity-check | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin/sanity-check') 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%:*}\$" | \ -- cgit v1.2.3-54-g00ecf