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

View File

@ -34,12 +34,12 @@ call_make()
status=1 status=1
log=`mktemp /tmp/astyle-log.XXXXXXXXXX` log=`mktemp /tmp/astyle-log.XXXXXXXXXX`
if [ -n "$log" ]; then if [ -n "$log" ]; then
make "$@" >$log 2>&1 make "$@" >"$log" 2>&1
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
cat $log >&2 cat "$log" >&2
fi fi
rm $log rm "$log"
fi fi
# Re-enable `set -e` if active before # Re-enable `set -e` if active before
@ -80,9 +80,9 @@ fi
# Put everything in this directory # Put everything in this directory
FILESDIR=$INSTALL_ROOT/$ASTYLE_VER 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" make_args="DESTDIR=$FILESDIR"
@ -93,14 +93,14 @@ fi
call_make $make_args call_make $make_args
echo "Installing astyle..." echo "Installing astyle..."
mkdir -p $FILESDIR mkdir -p "$FILESDIR"
call_make install $make_args call_make install $make_args
# make install DESTDIR=~/astyle.local/3.1 # make install DESTDIR=~/astyle.local/3.1
) )
status=$? status=$?
if [ $status -eq 0 ]; then if [ $status -eq 0 ]; then
rm -rf $workdir rm -rf "$workdir"
else else
"** Script failed. Work dir is $workdir" >&2 "** Script failed. Work dir is $workdir" >&2
fi fi

View File

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

View File

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

View File

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