Skip to content

Commit ebf2c74

Browse files
andy5995claude
andauthored
fix: resolve shellcheck warnings in test and packaging scripts (#518)
* fix: resolve shellcheck warnings in test and packaging scripts - Add missing shebang to doinst.sh (SC2148) - Quote variables throughout to prevent word splitting/globbing (SC2086) - Replace echo "\n" with printf for escape sequences (SC2028) - Replace backticks with $() (SC2006) - Replace expr with $(()) arithmetic (SC2003) - Replace [ ! $(grep ...) ] with ! grep -q (SC2143) - Replace ls | wc -l with find | wc -l (SC2012) - Replace printf "---\n" with echo for plain separator lines (SC3045) All scripts remain POSIX/dash compatible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: resolve shellcheck warnings in test_btrfs_clone.sh - Quote $(id -u) to prevent word splitting (SC2046) - Replace [ -n "$(mount | grep ...)" ] with mount | grep -q (SC2143) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: resolve shellcheck warnings in COMMON and fix CI path - Add shell directive to COMMON (SC2148) - Quote variables, fix backticks/expr, fix -o in [ ] (SC2086/SC2006/SC2003/SC2166) - Fix pattern expansion quoting in cmp_substr (SC2295) - Quote basename argument (SC2086) - Fix broken echo strings in error message - Remove unused TESTS_DIR variable - Add SC2034 disable comments for variables used by sourcing scripts - Update SHELLCHECK_OPTS path to test/ so shellcheck can follow COMMON source Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: trigger shellcheck CI re-run Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: use SCRIPTDIR so shellcheck can find COMMON on CI SHELLCHECK_OPTS used $GITHUB_WORKSPACE which GitHub Actions does not expand in env: blocks. SCRIPTDIR is shellcheck's built-in token that resolves to the directory of the script being checked, so shellcheck can find COMMON alongside each test script without a hardcoded path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: revert find to ls in test_basic.sh, disable SC2012 The OpenSUSE Tumbleweed CI container does not have 'find' in PATH. Revert to the original ls -A approach and suppress SC2012 since filenames in the waste folder are controlled and the count is reliable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 27f3a93 commit ebf2c74

File tree

9 files changed

+75
-63
lines changed

9 files changed

+75
-63
lines changed

.github/workflows/shellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- name: Run ShellCheck
2222
uses: ludeeus/action-shellcheck@master
2323
env:
24-
SHELLCHECK_OPTS: -x -P $GITHUB_WORKSPACE
24+
SHELLCHECK_OPTS: -x -P SCRIPTDIR

packaging/Slackbuild/rmw/doinst.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
DEPRECATED="etc/rmwrc"
23
if [ -f "$DEPRECATED" ]; then
34
rm "$DEPRECATED"

packaging/appimage/pre-appimage.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -ev
77

88
# Set default workspace if not provided
99
WORKSPACE=${WORKSPACE:-$(pwd)}
10-
echo $WORKSPACE
10+
echo "$WORKSPACE"
1111
# Check if the workspace path is absolute
1212
if [[ "$WORKSPACE" != /* ]]; then
1313
echo "The workspace path must be absolute"
@@ -23,7 +23,7 @@ if [[ "$SOURCE_ROOT" != /* ]]; then
2323
exit 1
2424
fi
2525
# Verify that you're in the source root
26-
echo $SOURCE_ROOT
26+
echo "$SOURCE_ROOT"
2727
test -f "$SOURCE_ROOT/src/main.c"
2828

2929
# Define and create application directory if it doesn't exist
@@ -62,7 +62,7 @@ fi
6262
cd "$BUILD_DIR"
6363
ninja
6464
meson test -v
65-
meson install --destdir=$APPDIR --skip-subprojects
65+
meson install --destdir="$APPDIR" --skip-subprojects
6666

6767
# Set up output directory
6868
OUT_DIR="$WORKSPACE/out"
@@ -76,9 +76,9 @@ export LINUXDEPLOY_OUTPUT_VERSION="$VERSION"
7676
# Generate AppImage using linuxdeploy
7777
linuxdeploy \
7878
--appdir="$APPDIR" \
79-
--custom-apprun=$SOURCE_ROOT/packaging/appimage/AppRun \
80-
-d $SOURCE_ROOT/packaging/rmw.desktop \
81-
--icon-file=$SOURCE_ROOT/packaging/rmw_icon_32x32.png \
79+
--custom-apprun="$SOURCE_ROOT"/packaging/appimage/AppRun \
80+
-d "$SOURCE_ROOT"/packaging/rmw.desktop \
81+
--icon-file="$SOURCE_ROOT"/packaging/rmw_icon_32x32.png \
8282
--icon-filename=rmw \
83-
--executable=$APPDIR/usr/bin/rmw \
83+
--executable="$APPDIR"/usr/bin/rmw \
8484
-o appimage

test/COMMON

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
1-
# included by tests scripts
1+
# shellcheck shell=sh
2+
# included by test scripts
23

34
create_some_files() {
45
mkdir -p somefiles/topdir/dir1/dir2/dir3
56

67
c=1
7-
while [ $c -lt 25 ]
8+
while [ "$c" -lt 25 ]
89
do
9-
touch somefiles/topdir/dir1/dir2/dir3/$c
10-
c=`expr $c + 1`
10+
touch "somefiles/topdir/dir1/dir2/dir3/$c"
11+
c=$((c + 1))
1112
done
1213

1314
touch somefiles/read_only_file
1415
chmod ugo-w somefiles/read_only_file
1516
}
1617

1718
cmp_substr () {
18-
if [ -z "$1" -o -z "$2" ]; then
19+
if [ -z "$1" ] || [ -z "$2" ]; then
1920
return 1
2021
fi
21-
[ -z "${1##*$2*}" ]
22+
[ -z "${1##*"$2"*}" ]
2223
return $?
2324
}
2425

2526
if test -z "${MESON_BUILD_ROOT}" || test -z "${RMW_FAKE_HOME}"; then
26-
echo "This script is used by the build system. Use 'meson test'
27-
echo 'from the builddir."
27+
echo "This script is used by the build system. Use 'meson test'"
28+
echo "from the builddir."
2829
exit 1
2930
fi
3031

31-
RMW_FAKE_HOME="${RMW_FAKE_HOME}"/$(basename $0)_dir
32-
TESTS_DIR="${MESON_SOURCE_ROOT}/test"
32+
RMW_FAKE_HOME="${RMW_FAKE_HOME}/$(basename "$0")_dir"
33+
# shellcheck disable=SC2034
3334
CONFIG="${MESON_SOURCE_ROOT}/test/conf/rmw.testrc"
35+
# shellcheck disable=SC2034
3436
ALT_CONFIG="${MESON_SOURCE_ROOT}/test/conf/rmw.alt.testrc"
37+
# shellcheck disable=SC2034
3538
PURGE_DISABLED_CONFIG="${MESON_SOURCE_ROOT}/test/conf/rmw.purge_disabled.testrc"
3639
export BIN_DIR="${MESON_BUILD_ROOT}"
3740

3841
export RMW_FAKE_HOME
3942

40-
if [ -e ${RMW_FAKE_HOME} ]; then
41-
rm -rf ${RMW_FAKE_HOME}
43+
if [ -e "${RMW_FAKE_HOME}" ]; then
44+
rm -rf "${RMW_FAKE_HOME}"
4245
fi
4346

47+
# shellcheck disable=SC2034
4448
RMW_TEST_CMD_STRING="${BIN_DIR}/rmw -c $CONFIG"
4549

46-
PRIMARY_WASTE_DIR="${RMW_FAKE_HOME}"/.Waste
50+
# shellcheck disable=SC2034
51+
PRIMARY_WASTE_DIR="${RMW_FAKE_HOME}/.Waste"
4752

53+
# shellcheck disable=SC2034
4854
RMW_ALT_TEST_CMD_STRING="${BIN_DIR}/rmw -c ${ALT_CONFIG}"
55+
# shellcheck disable=SC2034
4956
RMW_PURGE_DISABLED_CMD="${BIN_DIR}/rmw -c ${PURGE_DISABLED_CONFIG}"
57+
# shellcheck disable=SC2034
5058
SEPARATOR="\n\n--- "

test/test_basic.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ echo "rmw should display folders on removable devices that are not mounted"
1616
echo "$SEPARATOR"
1717
output="$($RMW_TEST_CMD_STRING -l)"
1818
echo "${output}"
19-
test "${output}" = "/mnt/fs/Trash-$(id -u)
19+
expected="/mnt/fs/Trash-$(id -u)
2020
/mnt/sda10000/example_waste
21-
"${MESON_BUILD_ROOT}"/test/rmw-tests-home/test_basic.sh_dir/.Waste
22-
"${MESON_BUILD_ROOT}"/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-2
23-
"${MESON_BUILD_ROOT}"/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-3"
21+
${MESON_BUILD_ROOT}/test/rmw-tests-home/test_basic.sh_dir/.Waste
22+
${MESON_BUILD_ROOT}/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-2
23+
${MESON_BUILD_ROOT}/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-3"
24+
test "${output}" = "${expected}"
2425

2526
echo "$SEPARATOR"
2627

@@ -29,13 +30,13 @@ cd "${RMW_FAKE_HOME}"
2930
mkdir tmp-files
3031
cd "${RMW_FAKE_HOME}"/tmp-files
3132

32-
echo "\n\n == creating temporary files to be deleted"
33+
printf "\n\n == creating temporary files to be deleted\n"
3334
for file in 1 2 3; do
3435
touch $file
3536
done
3637
cd "${RMW_FAKE_HOME}"/..
3738

38-
echo "\n\n == rmw should be able to operate on multiple files\n"
39+
printf "\n\n == rmw should be able to operate on multiple files\n"
3940
$RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/tmp-files/*
4041

4142
test -f "${PRIMARY_WASTE_DIR}/files/1"
@@ -53,24 +54,26 @@ for file in 1 2 3; do
5354
done
5455
$RMW_TEST_CMD_STRING 1 2 3
5556

56-
echo "\n\n == Show contents of the files and info directories"
57+
printf "\n\n == Show contents of the files and info directories\n"
5758

5859
test -n "$(ls -A "$PRIMARY_WASTE_DIR"/files)"
5960
test -n "$(ls -A "$PRIMARY_WASTE_DIR"/info)"
6061

62+
# shellcheck disable=SC2012
6163
output="$(ls -A "$PRIMARY_WASTE_DIR"/files | wc -l | sed 's/ //g')"
6264
test "$output" = "6"
6365

6466
echo "$SEPARATOR"
6567
echo " == rmw should refuse to move a waste folder or a file that resides within a waste folder"
6668
output="$($RMW_TEST_CMD_STRING "$PRIMARY_WASTE_DIR"/info || true)"
67-
test "${output}" = " :warning: "$PRIMARY_WASTE_DIR"/info resides within a waste folder and has been ignored
69+
expected=" :warning: ${PRIMARY_WASTE_DIR}/info resides within a waste folder and has been ignored
6870
0 items were removed to the waste folder"
71+
test "${output}" = "${expected}"
6972

7073
# If the file gets removed (which it shouldn't), then the test that follows it will fail
7174
$RMW_TEST_CMD_STRING "$PRIMARY_WASTE_DIR"/info/1.trashinfo || true
7275

73-
echo "\n\n == Display contents of 1.trashinfo "
76+
printf "\n\n == Display contents of 1.trashinfo \n"
7477
cat "$PRIMARY_WASTE_DIR"/info/1.trashinfo
7578

7679
echo "$SEPARATOR"
@@ -88,13 +91,13 @@ $RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/1
8891
$RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/2
8992
$RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/3
9093

91-
echo "\n\n == test that the files are restored to their previous locations"
94+
printf "\n\n == test that the files are restored to their previous locations\n"
9295

9396
test -f "${RMW_FAKE_HOME}"/tmp-files/1
9497
test -f "${RMW_FAKE_HOME}"/tmp-files/2
9598
test -f "${RMW_FAKE_HOME}"/tmp-files/3
9699

97-
echo "\n\n == test that the .trashinfo files have been removed"
100+
printf "\n\n == test that the .trashinfo files have been removed\n"
98101

99102
test ! -f "$PRIMARY_WASTE_DIR"/info/1.trashinfo
100103
test ! -f "$PRIMARY_WASTE_DIR"/info/2.trashinfo
@@ -118,7 +121,7 @@ cmp_substr "$($RMW_ALT_TEST_CMD_STRING -l)" \
118121
cmp_substr "$($RMW_TEST_CMD_STRING '')" \
119122
"skipping"
120123

121-
output=$($RMW_TEST_CMD_STRING ${RMW_FAKE_HOME})
124+
output=$($RMW_TEST_CMD_STRING "${RMW_FAKE_HOME}")
122125
cmp_substr "$output" "Skipping"
123126

124127
echo "Basic tests passed"

test/test_btrfs_clone.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ IS_BTRFS_MOUNTED="$(mount | grep rmw-btrfs)" || true
2222
if [ -z "$IS_BTRFS_MOUNTED" ]; then
2323
sudo mount -o loop "$IMAGE_PATH" \
2424
"$BTRFS_IMAGE_MOUNTPOINT"
25-
sudo chown $(id -u) -R "$BTRFS_IMAGE_MOUNTPOINT"
25+
sudo chown "$(id -u)" -R "$BTRFS_IMAGE_MOUNTPOINT"
2626
fi
2727

2828
cd "$BTRFS_IMAGE_MOUNTPOINT"
@@ -70,7 +70,7 @@ test -f foo
7070

7171
cd
7272

73-
if [ -n "$(mount | grep rmw-btrfs)" ]; then
73+
if mount | grep -q rmw-btrfs; then
7474
sudo umount "$BTRFS_IMAGE_MOUNTPOINT"
7575
fi
7676

test/test_media_root.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ PREV_RMW_FAKE_HOME=${RMW_FAKE_HOME}
3737
unset RMW_FAKE_HOME
3838
mkdir -p "$PREV_RMW_FAKE_HOME"
3939
test_file_path=${PREV_RMW_FAKE_HOME}/$test_file
40-
if test -f $test_file_path; then
41-
rm $test_file_path
40+
if test -f "$test_file_path"; then
41+
rm "$test_file_path"
4242
fi
4343
if test -f /home/andy/src/rmw-project/.Trash-1000/files/$test_file; then
4444
rm /home/andy/src/rmw-project/.Trash-1000/files/$test_file
4545
fi
4646
if test -f /home/andy/src/rmw-project/.Trash-1000/info/$test_file.trashinfo; then
4747
rm /home/andy/src/rmw-project/.Trash-1000/info/$test_file.trashinfo
4848
fi
49-
touch $test_file_path
50-
$BIN_DIR/rmw -c /home/andy/.config/rmwrc $test_file_path
49+
touch "$test_file_path"
50+
"$BIN_DIR"/rmw -c /home/andy/.config/rmwrc "$test_file_path"
5151

5252
output=$(grep Path /home/andy/src/rmw-project/.Trash-1000/info/$test_file.trashinfo)
5353

5454
# There should be no leading '/' in the filename.
55-
path_expected=$(echo ${MESON_BUILD_ROOT} | sed -e "s/\/home\/andy\/src\/rmw-project\///g")
56-
echo $path_expected
55+
path_expected=$(echo "${MESON_BUILD_ROOT}" | sed -e "s/\/home\/andy\/src\/rmw-project\///g")
56+
echo "$path_expected"
5757
test "$output" = "Path=${path_expected}/test/rmw-tests-home/test_media_root.sh_dir/media_root_test"
5858

59-
output=$($BIN_DIR/rmw -uvv -c /home/andy/.config/rmwrc | grep media_root_test)
59+
output=$("$BIN_DIR"/rmw -uvv -c /home/andy/.config/rmwrc | grep media_root_test)
6060

6161
test "$output" = "+'/home/andy/src/rmw-project/.Trash-1000/files/media_root_test' -> '${MESON_BUILD_ROOT}/test/rmw-tests-home/test_media_root.sh_dir/media_root_test'
6262
-/home/andy/src/rmw-project/.Trash-1000/info/media_root_test.trashinfo"

test/test_purging.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ cd "${RMW_FAKE_HOME}"/tmp-files
2626
create_temp_files() {
2727
cd "${RMW_FAKE_HOME}"/tmp-files
2828

29-
echo "\n\n == creating temporary files to be rmw'ed"
29+
printf "\n\n == creating temporary files to be rmw'ed\n"
3030

3131
for file in abc 123 xyz; do
3232
i=0
3333
while [ "$i" -lt 8 ]
3434
do
35-
echo "0000" >> $file
36-
i=`expr $i + 1`
35+
echo "0000" >> "$file"
36+
i=$((i + 1))
3737
done
3838
done
3939
}
@@ -53,13 +53,12 @@ $RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/somefiles/*
5353

5454
echo "$SEPARATOR"
5555
echo ' == purging disabled should output a message that purging is disabled'
56-
output=`$RMW_PURGE_DISABLED_CMD --empty -f`
57-
expected=`echo "purging is disabled ('expire_age' is set to '0')" | cut -b1-20`
58-
output=`echo $output | cut -b1-20`
56+
output=$($RMW_PURGE_DISABLED_CMD --empty -f)
57+
expected=$(echo "purging is disabled ('expire_age' is set to '0')" | cut -b1-20)
58+
output=$(echo "$output" | cut -b1-20)
5959
test "${output}" = "${expected}"
6060

6161
# Should not work if '-f' isn't used"
62-
substring=
6362
cmp_substr "$(echo y | $RMW_ALT_TEST_CMD_STRING --purge --empty)" \
6463
"purge has been skipped"
6564

@@ -79,7 +78,7 @@ test -e "$PRIMARY_WASTE_DIR"/files/topdir
7978
echo "$SEPARATOR"
8079
echo " == Make sure the correct string (filename) is displayed when using -vvg"
8180
output="$($RMW_TEST_CMD_STRING -vvg)"
82-
echo $output
81+
echo "$output"
8382
cmp_substr "$output" "'read_only_file' will be purged in 90$(locale decimal_point)"
8483
cmp_substr "$output" "'topdir' will be purged in 90$(locale decimal_point)"
8584

@@ -116,9 +115,9 @@ test ! -e "$PRIMARY_WASTE_DIR"/info/xyz.trashinfo
116115
create_temp_files
117116

118117
cd "${RMW_FAKE_HOME}"/..
119-
echo "\n\n == use a built-in environmental variable to write a"
118+
printf "\n\n == use a built-in environmental variable to write a\n"
120119
echo " == fake year to the .trashinfo files when running rmw"
121-
echo "-----------------------------------------------------\n"
120+
echo "-----------------------------------------------------"
122121

123122
RMW_FAKE_YEAR=true $RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/tmp-files/*
124123
cmp_substr "$(cat "$PRIMARY_WASTE_DIR"/info/abc.trashinfo)" \
@@ -167,7 +166,7 @@ echo " == Test 'show_purge_stats' == "
167166
create_temp_files
168167
RMW_FAKE_YEAR=True $RMW_TEST_CMD_STRING "${RMW_FAKE_HOME}"/tmp-files/*
169168
output=$($RMW_TEST_CMD_STRING -g)
170-
echo $output
169+
echo "$output"
171170
cmp_substr "$output" "Purging files based"
172171
cmp_substr "$output" "3 items purged"
173172

test/test_restore.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ echo "OUTPUT:"
4141
echo "---"
4242
echo "$output"
4343
echo "---"
44-
test "$output" = "+'"${RMW_FAKE_HOME}"/.Waste/files/read_only_file' -> '"${RMW_FAKE_HOME}"/somefiles/read_only_file'
45-
-"${RMW_FAKE_HOME}"/.Waste/info/read_only_file.trashinfo
46-
+'"${RMW_FAKE_HOME}"/.Waste/files/topdir' -> '"${RMW_FAKE_HOME}"/somefiles/topdir'
47-
-"${RMW_FAKE_HOME}"/.Waste/info/topdir.trashinfo"
44+
expected="+'${RMW_FAKE_HOME}/.Waste/files/read_only_file' -> '${RMW_FAKE_HOME}/somefiles/read_only_file'
45+
-${RMW_FAKE_HOME}/.Waste/info/read_only_file.trashinfo
46+
+'${RMW_FAKE_HOME}/.Waste/files/topdir' -> '${RMW_FAKE_HOME}/somefiles/topdir'
47+
-${RMW_FAKE_HOME}/.Waste/info/topdir.trashinfo"
48+
test "$output" = "$expected"
4849

4950
echo "$SEPARATOR"
5051
echo "Show result when no undo file exists..."
@@ -74,7 +75,7 @@ $RMW_TEST_CMD_STRING -z nonexistent_fil* && exit 1
7475

7576
echo "$SEPARATOR"
7677
echo "Symlinks"
77-
ln -s ${RMW_FAKE_HOME} "${RMW_FAKE_HOME}"/link_test
78+
ln -s "${RMW_FAKE_HOME}" "${RMW_FAKE_HOME}"/link_test
7879
# broken link
7980
ln -s broken_symlink_test "${RMW_FAKE_HOME}"/link_test2
8081
$RMW_TEST_CMD_STRING "${RMW_FAKE_HOME}"/link_test "${RMW_FAKE_HOME}"/link_test2
@@ -89,8 +90,8 @@ mkdir tmpfoo
8990
for t in "foo" "bar" ".boo" ".far"; do
9091
touch tmpfoo/$t
9192
${RMW_TEST_CMD_STRING} tmpfoo/$t
92-
cat ${PRIMARY_WASTE_DIR}/info/$t.trashinfo
93-
cd ${PRIMARY_WASTE_DIR}
93+
cat "${PRIMARY_WASTE_DIR}/info/$t.trashinfo"
94+
cd "${PRIMARY_WASTE_DIR}"
9495
${RMW_TEST_CMD_STRING} -z files/$t
9596
cd "${RMW_FAKE_HOME}"
9697
test -f tmpfoo/$t
@@ -100,17 +101,17 @@ done
100101
for t in ".boo" ".far"; do
101102
touch tmpfoo/$t
102103
${RMW_TEST_CMD_STRING} tmpfoo/.*
103-
${RMW_TEST_CMD_STRING} -z ${PRIMARY_WASTE_DIR}/files/$t
104+
${RMW_TEST_CMD_STRING} -z "${PRIMARY_WASTE_DIR}/files/$t"
104105
test -f tmpfoo/$t
105106
done
106107

107108
# a dot dir
108-
cmp_substr "$(${RMW_TEST_CMD_STRING} -z ${PRIMARY_WASTE_DIR}/files/. && exit 1)" \
109+
cmp_substr "$(${RMW_TEST_CMD_STRING} -z "${PRIMARY_WASTE_DIR}/files/." && exit 1)" \
109110
"refusing to process"
110111

111112
# I don't want to force anyone to install Xvfb for this single test
112113
# so I'll only run it if it's already installed
113-
if [ -n "$(command -v Xvfb)" ] && [ ! $(grep "DISABLE_CURSES" "$MESON_BUILD_ROOT/src/config.h") ]; then
114+
if [ -n "$(command -v Xvfb)" ] && ! grep -q "DISABLE_CURSES" "$MESON_BUILD_ROOT/src/config.h"; then
114115
# Start Xvfb on display :99
115116
Xvfb :99 &
116117
XVFB_PID=$!

0 commit comments

Comments
 (0)