]> wimlib.net Git - wimlib/commitdiff
tools: address all shellcheck warnings
authorEric Biggers <ebiggers3@gmail.com>
Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)
tools/make-releases.sh
tools/run-sparse.sh
tools/test-examples.sh
tools/update-version.sh

index bf61c34579d98237747a44e6df6d7340e50d9959..eac1712e4a390f5021046afc0ac3581ff676236e 100755 (executable)
@@ -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
index 828aebe774661ad1ce7e8617eb9f17e40c747fd8..6a7c91591496dfd5bdf0516531c235e136ad063a 100755 (executable)
@@ -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
index 8e4ac66fc7e21d8c3fb46356984d897ebc18c14b..f3a93f932ab9e4b2d63cac2ede02702f06f3cb7a 100755 (executable)
@@ -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"
index 7e108638fc8d90dc2f9d6a38c3829418d4cfb7ee..a62b3b890cf19e65883ac40fd29ac82693576736 100755 (executable)
@@ -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/"        \