From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:09 +0000 (+0100) Subject: fix: shellcheck for dracut-catimages.sh X-Git-Tag: 052~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22fceeac80398fc22ebbef886d5c8b37e28f51ca;p=thirdparty%2Fdracut.git fix: shellcheck for dracut-catimages.sh --- diff --git a/dracut-catimages.sh b/dracut-catimages.sh index 1f53a2d38..c3c4d094e 100755 --- a/dracut-catimages.sh +++ b/dracut-catimages.sh @@ -18,7 +18,7 @@ dwarning() { - echo "Warning: $@" >&2 + echo "Warning: $*" >&2 } dinfo() { @@ -26,7 +26,7 @@ dinfo() { } derror() { - echo "Error: $@" >&2 + echo "Error: $*" >&2 } usage() { @@ -61,7 +61,7 @@ while (($# > 0)); do --nooverlay) no_overlay=yes;shift;; --noimagedir) no_imagedir=yes;shift;; -h|--help) usage; exit 1 ;; - --debug) debug="yes";; + --debug) export debug="yes";; -v|--verbose) beverbose="yes";; -*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;; *) break ;; @@ -104,7 +104,7 @@ if [[ ! $no_overlay ]]; then ofile="$imagedir/90-overlay.img" dinfo "Creating image $ofile from directory $overlay" type pigz &>/dev/null && gzip=pigz || gzip=gzip - ( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; ) + ( cd "$overlay" || return 1 ; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; ) fi if [[ ! $no_imagedir ]]; then @@ -113,7 +113,7 @@ if [[ ! $no_imagedir ]]; then done fi -images+=($@) +images+=( "$@" ) dinfo "Using base image $baseimage" cat -- "$baseimage" > "$outfile"