From 924f7126f12fa7bdbd3e4c0fc5699fe52fd12436 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 1 Apr 2023 23:29:13 -0700 Subject: [PATCH] tools: address all shellcheck warnings --- tools/make-releases.sh | 6 +++--- tools/run-sparse.sh | 2 +- tools/test-examples.sh | 2 +- tools/update-version.sh | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/make-releases.sh b/tools/make-releases.sh index bf61c345..eac1712e 100755 --- a/tools/make-releases.sh +++ b/tools/make-releases.sh @@ -11,10 +11,10 @@ autoreconf -i -f # make sure the version number gets updated ./configure && $MAKE distcheck # Recompress with libdeflate -gzfile=$(ls wimlib-*.tar.gz | tail -1) +gzfile=$(find . -name 'wimlib-*.tar.gz' | tail -1) tarfile=${gzfile%.gz} -libdeflate-gunzip $gzfile -libdeflate-gzip -12 $tarfile +libdeflate-gunzip "$gzfile" +libdeflate-gzip -12 "$tarfile" for arch in i686 x86_64; do ./tools/windows-build.sh --arch=$arch --include-docs --zip diff --git a/tools/run-sparse.sh b/tools/run-sparse.sh index 828aebe7..6a7c9159 100755 --- a/tools/run-sparse.sh +++ b/tools/run-sparse.sh @@ -1,7 +1,7 @@ #!/bin/sh for fil in src/*.c programs/imagex.c; do - sparse $fil -gcc-base-dir `gcc --print-file-name=` \ + sparse "$fil" -gcc-base-dir "$(gcc --print-file-name=)" \ -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -D_GNU_SOURCE \ -I. -Iinclude -Wbitwise -Wpointer-subtraction-blows done diff --git a/tools/test-examples.sh b/tools/test-examples.sh index 8e4ac66f..f3a93f93 100755 --- a/tools/test-examples.sh +++ b/tools/test-examples.sh @@ -21,7 +21,7 @@ tmpdir="$(mktemp -d)" tmpfile="$(mktemp)" tmpfile2="$(mktemp)" -trap "rm -rf \"$tmpdir\" \"$tmpfile\" \"$tmpfile2\"" EXIT +trap 'rm -rf "$tmpdir" "$tmpfile" "$tmpfile2"' EXIT do_test() { rm -rf "$tmpdir" diff --git a/tools/update-version.sh b/tools/update-version.sh index 7e108638..a62b3b89 100755 --- a/tools/update-version.sh +++ b/tools/update-version.sh @@ -10,7 +10,7 @@ fi oldmonth=$(head -1 doc/man1/wimcapture.1 | cut -d' ' -f4 | tr -d '"') oldyear=$(head -1 doc/man1/wimcapture.1 | cut -d' ' -f5 | tr -d '"') oldver=$(grep 'the library interface of wimlib' include/wimlib.h \ - | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') + | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+') newver=$1 newmajor=$(echo "$newver" | cut -d'.' -f1) @@ -25,10 +25,10 @@ sed -i "s/$pat/This is wimlib version $newver ($newmonth $newyear)/" README sed -i "s/$oldver/$newver/" tools/get-version-number.sh README.WINDOWS -sed -i -e 's/\(#define WIMLIB_MAJOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newmajor'/' \ - -e 's/\(#define WIMLIB_MINOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newminor'/' \ - -e 's/\(#define WIMLIB_PATCH_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'$newpatch'/' \ - -e 's/\(the library interface of wimlib \)'$oldver'/\1'$newver'/' \ +sed -i -e 's/\(#define WIMLIB_MAJOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'"$newmajor"'/' \ + -e 's/\(#define WIMLIB_MINOR_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'"$newminor"'/' \ + -e 's/\(#define WIMLIB_PATCH_VERSION[[:space:]]\+\)[[:digit:]]\+/\1'"$newpatch"'/' \ + -e 's/\(the library interface of wimlib \)'"$oldver"'/\1'"$newver"'/' \ include/wimlib.h sed -i -e "1s/$oldmonth $oldyear/$newmonth $newyear/;1s/wimlib $oldver/wimlib $newver/" \ -- 2.43.0