fix some shellcheck warnings

This commit is contained in:
a1346054 2022-09-03 00:50:56 +00:00
parent 0c942feaff
commit 59f8d9fe07
No known key found for this signature in database
GPG Key ID: D149AD21DC40440C
8 changed files with 25 additions and 25 deletions

View File

@ -22,8 +22,8 @@ find_pam_module_dir()
# Looks for the pam security module directory
set -- $pam_module_dir_searchpath
for d in "$@"; do
if [ -s $d/pam_unix.so ]; then
echo $d
if [ -s "$d/pam_unix.so" ]; then
echo "$d"
break
fi
done
@ -34,7 +34,7 @@ can_apply_unix_config()
result=0
module_dir="$1"
for m in $unix_modules_needed; do
if [ ! -s $module_dir/$m ]; then
if [ ! -s "$module_dir/$m" ]; then
echo " ** $m not found" >&2
result=1
fi

View File

@ -34,12 +34,12 @@ call_make()
status=1
log=`mktemp /tmp/astyle-log.XXXXXXXXXX`
if [ -n "$log" ]; then
make "$@" >$log 2>&1
make "$@" >"$log" 2>&1
status=$?
if [ $status -ne 0 ]; then
cat $log >&2
cat "$log" >&2
fi
rm $log
rm "$log"
fi
# Re-enable `set -e` if active before
@ -80,27 +80,27 @@ fi
# Put everything in this directory
FILESDIR=$INSTALL_ROOT/$ASTYLE_VER
svn checkout ${REPO_URL}/${ASTYLE_VER}/AStyle $workdir
svn checkout ${REPO_URL}/${ASTYLE_VER}/AStyle "$workdir"
cd $workdir
cd "$workdir"
make_args="DESTDIR=$FILESDIR"
echo "Creating Makefiles..."
cmake .
echo "Making astyle..."
call_make $make_args
echo "Installing astyle..."
mkdir -p $FILESDIR
mkdir -p "$FILESDIR"
call_make install $make_args
# make install DESTDIR=~/astyle.local/3.1
)
status=$?
if [ $status -eq 0 ]; then
rm -rf $workdir
rm -rf "$workdir"
else
"** Script failed. Work dir is $workdir" >&2
fi

View File

@ -2,6 +2,6 @@
set -eufx
PACKAGES="subversion cmake"
apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES

View File

@ -34,12 +34,12 @@ call_make()
status=1
log=`mktemp /tmp/cppcheck-log.XXXXXXXXXX`
if [ -n "$log" ]; then
make "$@" >$log 2>&1
make "$@" >"$log" 2>&1
status=$?
if [ $status -ne 0 ]; then
cat $log >&2
cat "$log" >&2
fi
rm $log
rm "$log"
fi
# Re-enable `set -e` if active before
@ -119,9 +119,9 @@ fi
# See https://stackoverflow.com/questions/
# 791959/download-a-specific-tag-with-git
git clone -b $CPPCHECK_VER --depth 1 $REPO_URL $workdir
git clone -b "$CPPCHECK_VER" --depth 1 "$REPO_URL" "$workdir"
cd $workdir
cd "$workdir"
case "$CPPCHECK_VER" in
1.*)
@ -145,13 +145,13 @@ fi
call_make $make_args
echo "Installing cppcheck..."
mkdir -p $FILESDIR
mkdir -p "$FILESDIR"
call_make install $make_args
)
status=$?
if [ $status -eq 0 ]; then
rm -rf $workdir
rm -rf "$workdir"
else
"** Script failed. Work dir is $workdir" >&2
fi

View File

@ -2,6 +2,6 @@
set -eufx
PACKAGES="libz3-dev z3"
apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES

View File

@ -70,7 +70,7 @@ in
libx11-dev \
libxrandr-dev \
libxfixes-dev"
case "$FEATURE_SET"
in
min)
@ -112,7 +112,7 @@ in
libxrandr-dev:i386 \
libxrender-dev:i386 \
libfuse-dev:i386"
dpkg --add-architecture i386
dpkg --print-architecture
dpkg --print-foreign-architectures

View File

@ -69,6 +69,6 @@ ASTYLE_FLAGS="--options=astyle_config.as ./\*.c ./\*.h"
# Display the astyle version and command for debugging
"$ASTYLE" --version && {
echo Command: $ASTYLE $ASTYLE_FLAGS
echo "Command: $ASTYLE $ASTYLE_FLAGS"
"$ASTYLE" $ASTYLE_FLAGS
}

View File

@ -53,6 +53,6 @@ fi
# Display the cppcheck version and command for debugging
"$CPPCHECK" --version && {
echo Command: $CPPCHECK $CPPCHECK_FLAGS "$@"
echo "Command: $CPPCHECK $CPPCHECK_FLAGS" "$@"
"$CPPCHECK" $CPPCHECK_FLAGS "$@"
}