Skip to content

Commit a7bcae6

Browse files
Fix various shellcheck warnings
1 parent 3725412 commit a7bcae6

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

examples/build_dir.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set -v # Print executed lines
1616

1717
BUILD_DIR="${TRAVIS_BUILD_DIR:-$(mktemp -d)}/b"
1818

19-
mkdir -p ${BUILD_DIR}
19+
mkdir -p "${BUILD_DIR}"
2020

2121
# The --sudo option is typically needed when installing to standard locations.
2222
# Note that `sudo ./install_gpg_all …` is not the same—it would compile as
@@ -45,9 +45,9 @@ gpg --version | head -n 1 | cut -d" " -f 3 | grep -xE "2\.2\.[0-9]+"
4545

4646
# Assert that ${BUILD_DIR} is now full of files (cause build had happened
4747
# there)…
48-
pushd ${BUILD_DIR}
48+
pushd "${BUILD_DIR}"
4949
ls -d libgpg-error-*
5050
ls -d gnupg-*
51-
[[ -f "$(ls | grep "libgpg-error-")/Makefile" ]]
52-
[[ -f "$(ls | grep "gnupg-")/Makefile" ]]
51+
ls libgpg-error-*/Makefile
52+
ls gnupg-*/Makefile
5353
popd

examples/components_individually.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ gpg --version
7777
gpg --version | head -n 1 | cut -d" " -f 3 | grep -xF "2.2.20"
7878

7979
# Assert configured algorithms (enabled SHA256 and disabled SHA512)…
80-
gpg --version | grep -i "SHA256"
81-
[[ ! $(gpg --version | grep -i "SHA512") ]]
80+
gpg --version | grep -q -i "SHA256"
81+
gpg --version | grep -q -v -i "SHA512"
8282

8383
# Assert disabled docs for libgpg-error, and enabled for other packages…
8484
[[ -f "/usr/local/share/man/man1/gpg.1" ]]
8585
[[ ! -f "/usr/local/share/man/man1/gpg-error-config.1" ]]
8686

8787
# Assert that building the libgcrypt component has happened in a $BUILD_DIR,
8888
# and no other component was built there…
89-
pushd ${BUILD_DIR}
89+
pushd "${BUILD_DIR}"
9090
ls -d libgcrypt-*
91-
[[ ! $(ls . | grep -v "libgcrypt-") ]]
92-
[[ -f "$(ls | grep "libgcrypt-")/Makefile" ]]
91+
ls libgcrypt-*
92+
ls libgcrypt-*/Makefile
9393
popd

examples/configure_options.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ gpg --version | head -n 1 | cut -d" " -f 3 | grep -xE "2\.2\.[0-9]+"
3737
[[ ! -f "/usr/local/share/man/man7/gnupg.7" ]]
3838

3939
# Assert configured algorithms (enabled SHA256 and disabled SHA512)…
40-
gpg --version | grep -i "SHA256"
40+
gpg --version | grep -q -i "SHA256"
4141
gpg --version | grep -q -v -i "SHA512"

examples/install_prefix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GPG_CONFIGURE_OPTS="--prefix=${GPG_PREFIX} \
3030
# provided with $PATH and $GPG_PREFIX, hence we must enhance $PATH.
3131
export PATH="${EXEC_PREFIX}/bin:${PATH}"
3232

33-
mkdir -p ${GPG_PREFIX} ${EXEC_PREFIX} ${MAN_DIR}
33+
mkdir -p "${GPG_PREFIX}" "${EXEC_PREFIX}" "${MAN_DIR}"
3434

3535
# The --ldconfig option is typically needed on GNU+Linux systems. It causes
3636
# `ldconfig` to be run right after installing each component in order to

examples/no_sudo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export LD_RUN_PATH="${GPG_PREFIX}/lib:${LD_RUN_PATH}"
2727
# provided with $PATH and $GPG_PREFIX, hence we must enhance $PATH.
2828
export PATH="${GPG_PREFIX}/bin:${PATH}"
2929

30-
mkdir -p ${GPG_PREFIX}
30+
mkdir -p "${GPG_PREFIX}"
3131

3232
./install_gpg_all.sh --suite-version latest --no-sudo \
3333
--configure-opts "${GPG_CONFIGURE_OPTS}" "$@"

0 commit comments

Comments
 (0)