Skip to content

Commit 29be738

Browse files
committed
shellcheck: fix some double-quoting warning
1 parent c69b73c commit 29be738

File tree

5 files changed

+104
-103
lines changed

5 files changed

+104
-103
lines changed

packaging/appimage/pre-appimage.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set -ev
77

88
# Set default workspace if not provided
99
WORKSPACE=${WORKSPACE:-$(pwd)}
10+
echo $WORKSPACE
1011
# Check if the workspace path is absolute
1112
if [[ "$WORKSPACE" != /* ]]; then
1213
echo "The workspace path must be absolute"

test/COMMON

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if test -z "${MESON_BUILD_ROOT}" || test -z "${RMW_FAKE_HOME}"; then
2828
exit 1
2929
fi
3030

31-
RMW_FAKE_HOME=${RMW_FAKE_HOME}/$(basename $0)_dir
31+
RMW_FAKE_HOME="${RMW_FAKE_HOME}"/$(basename $0)_dir
3232
TESTS_DIR="${MESON_SOURCE_ROOT}/test"
3333
CONFIG="${MESON_SOURCE_ROOT}/test/conf/rmw.testrc"
3434
ALT_CONFIG="${MESON_SOURCE_ROOT}/test/conf/rmw.alt.testrc"
@@ -43,7 +43,7 @@ fi
4343

4444
RMW_TEST_CMD_STRING="${BIN_DIR}/rmw -c $CONFIG"
4545

46-
PRIMARY_WASTE_DIR=${RMW_FAKE_HOME}/.Waste
46+
PRIMARY_WASTE_DIR="${RMW_FAKE_HOME}"/.Waste
4747

4848
RMW_ALT_TEST_CMD_STRING="${BIN_DIR}/rmw -c ${ALT_CONFIG}"
4949
RMW_PURGE_DISABLED_CMD="${BIN_DIR}/rmw -c ${PURGE_DISABLED_CONFIG}"

test/test_basic.sh

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ fi
1010
echo "== On first run, directories should get created"
1111
$RMW_TEST_CMD_STRING
1212

13-
echo $SEPARATOR
13+
echo "$SEPARATOR"
1414
echo "List the waste folders..."
1515
echo "rmw should display folders on removable devices that are not mounted"
16-
echo $SEPARATOR
16+
echo "$SEPARATOR"
1717
output="$($RMW_TEST_CMD_STRING -l)"
1818
echo "${output}"
1919
test "${output}" = "/mnt/fs/Trash-$(id -u)
@@ -22,21 +22,21 @@ test "${output}" = "/mnt/fs/Trash-$(id -u)
2222
"${MESON_BUILD_ROOT}"/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-2
2323
"${MESON_BUILD_ROOT}"/test/rmw-tests-home/test_basic.sh_dir/.local/share/Waste-3"
2424

25-
echo $SEPARATOR
25+
echo "$SEPARATOR"
2626

2727
cd "${RMW_FAKE_HOME}"
2828
# Make some temporary files
2929
mkdir tmp-files
30-
cd "${RMW_FAKE_HOME}/tmp-files"
30+
cd "${RMW_FAKE_HOME}"/tmp-files
3131

3232
echo "\n\n == creating temporary files to be deleted"
3333
for file in 1 2 3; do
3434
touch $file
3535
done
36-
cd ${RMW_FAKE_HOME}/..
36+
cd "${RMW_FAKE_HOME}"/..
3737

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

4141
test -f "${PRIMARY_WASTE_DIR}/files/1"
4242
test -f "${PRIMARY_WASTE_DIR}/files/2"
@@ -45,60 +45,60 @@ test -f "${PRIMARY_WASTE_DIR}/info/1.trashinfo"
4545
test -f "${PRIMARY_WASTE_DIR}/info/2.trashinfo"
4646
test -f "${PRIMARY_WASTE_DIR}/info/3.trashinfo"
4747

48-
echo $SEPARATOR
48+
echo "$SEPARATOR"
4949
echo "rmw should append a time_string to duplicate files..."
50-
cd ${RMW_FAKE_HOME}/tmp-files
50+
cd "${RMW_FAKE_HOME}"/tmp-files
5151
for file in 1 2 3; do
5252
touch $file
5353
done
5454
$RMW_TEST_CMD_STRING 1 2 3
5555

5656
echo "\n\n == Show contents of the files and info directories"
5757

58-
test -n "$(ls -A $PRIMARY_WASTE_DIR/files)"
59-
test -n "$(ls -A $PRIMARY_WASTE_DIR/info)"
58+
test -n "$(ls -A "$PRIMARY_WASTE_DIR"/files)"
59+
test -n "$(ls -A "$PRIMARY_WASTE_DIR"/info)"
6060

61-
output="$(ls -A $PRIMARY_WASTE_DIR/files | wc -l | sed 's/ //g')"
61+
output="$(ls -A "$PRIMARY_WASTE_DIR"/files | wc -l | sed 's/ //g')"
6262
test "$output" = "6"
6363

64-
echo $SEPARATOR
64+
echo "$SEPARATOR"
6565
echo " == rmw should refuse to move a waste folder or a file that resides within a waste folder"
66-
output="$($RMW_TEST_CMD_STRING $PRIMARY_WASTE_DIR/info)"
67-
test "${output}" = " :warning: $PRIMARY_WASTE_DIR/info resides within a waste folder and has been ignored
66+
output="$($RMW_TEST_CMD_STRING "$PRIMARY_WASTE_DIR"/info)"
67+
test "${output}" = " :warning: "$PRIMARY_WASTE_DIR"/info resides within a waste folder and has been ignored
6868
0 items were removed to the waste folder"
6969

7070
# If the file gets removed (which it shouldn't), then the test that follows it will fail
71-
$RMW_TEST_CMD_STRING $PRIMARY_WASTE_DIR/info/1.trashinfo
71+
$RMW_TEST_CMD_STRING "$PRIMARY_WASTE_DIR"/info/1.trashinfo
7272

7373
echo "\n\n == Display contents of 1.trashinfo "
74-
cat $PRIMARY_WASTE_DIR/info/1.trashinfo
74+
cat "$PRIMARY_WASTE_DIR"/info/1.trashinfo
7575

76-
echo $SEPARATOR
76+
echo "$SEPARATOR"
7777
echo " == Test -m option"
7878
output=$($RMW_TEST_CMD_STRING --verbose -m)
7979
cmp_substr "$output" ".Waste/files/1_"
8080
cmp_substr "$output" ".Waste/files/2_"
8181
cmp_substr "$output" ".Waste/files/3_"
8282

83-
echo $SEPARATOR
83+
echo "$SEPARATOR"
8484
echo " == test undo/restore feature"
8585

8686
$RMW_TEST_CMD_STRING --verbose -u
87-
$RMW_TEST_CMD_STRING --verbose -z $PRIMARY_WASTE_DIR/files/1
88-
$RMW_TEST_CMD_STRING --verbose -z $PRIMARY_WASTE_DIR/files/2
89-
$RMW_TEST_CMD_STRING --verbose -z $PRIMARY_WASTE_DIR/files/3
87+
$RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/1
88+
$RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/2
89+
$RMW_TEST_CMD_STRING --verbose -z "$PRIMARY_WASTE_DIR"/files/3
9090

9191
echo "\n\n == test that the files are restored to their previous locations"
9292

93-
test -f ${RMW_FAKE_HOME}/tmp-files/1
94-
test -f ${RMW_FAKE_HOME}/tmp-files/2
95-
test -f ${RMW_FAKE_HOME}/tmp-files/3
93+
test -f "${RMW_FAKE_HOME}"/tmp-files/1
94+
test -f "${RMW_FAKE_HOME}"/tmp-files/2
95+
test -f "${RMW_FAKE_HOME}"/tmp-files/3
9696

9797
echo "\n\n == test that the .trashinfo files have been removed"
9898

99-
test ! -f $PRIMARY_WASTE_DIR/info/1.trashinfo
100-
test ! -f $PRIMARY_WASTE_DIR/info/2.trashinfo
101-
test ! -f $PRIMARY_WASTE_DIR/info/3.trashinfo
99+
test ! -f "$PRIMARY_WASTE_DIR"/info/1.trashinfo
100+
test ! -f "$PRIMARY_WASTE_DIR"/info/2.trashinfo
101+
test ! -f "$PRIMARY_WASTE_DIR"/info/3.trashinfo
102102

103103
# Ignore dot directories
104104
mkdir tmpdot

test/test_purging.sh

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ echo "== On first run, directories should get created"
1919
$RMW_TEST_CMD_STRING
2020

2121
# Make some temporary files using a fake-year
22-
mkdir ${RMW_FAKE_HOME}/tmp-files
23-
cd ${RMW_FAKE_HOME}/tmp-files
22+
mkdir "${RMW_FAKE_HOME}"/tmp-files
23+
cd "${RMW_FAKE_HOME}"/tmp-files
2424

2525

2626
create_temp_files() {
27-
cd ${RMW_FAKE_HOME}/tmp-files
27+
cd "${RMW_FAKE_HOME}"/tmp-files
2828

2929
echo "\n\n == creating temporary files to be rmw'ed"
3030

@@ -41,17 +41,17 @@ create_temp_files() {
4141
echo
4242
echo
4343
echo " Creating some files for testing..."
44-
cd ${RMW_FAKE_HOME}
44+
cd "${RMW_FAKE_HOME}"
4545
create_some_files
4646

4747
echo
4848
echo
4949
echo " == rmw --empty command should completely purge the waste folders,"
5050
echo " == no matter when they were deleted"
5151

52-
$RMW_TEST_CMD_STRING --verbose ${RMW_FAKE_HOME}/somefiles/*
52+
$RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/somefiles/*
5353

54-
echo $SEPARATOR
54+
echo "$SEPARATOR"
5555
echo ' == purging disabled should output a message that purging is disabled'
5656
output=`$RMW_PURGE_DISABLED_CMD --empty -f`
5757
expected=`echo "purging is disabled ('expire_age' is set to '0')" | cut -b1-20`
@@ -73,99 +73,99 @@ echo "n" | $RMW_TEST_CMD_STRING --purge --empty
7373
echo "Nqer" | $RMW_TEST_CMD_STRING --purge --empty
7474

7575
echo " == (files should still be present)"
76-
test -e $PRIMARY_WASTE_DIR/files/read_only_file
77-
test -e $PRIMARY_WASTE_DIR/files/topdir
76+
test -e "$PRIMARY_WASTE_DIR"/files/read_only_file
77+
test -e "$PRIMARY_WASTE_DIR"/files/topdir
7878

79-
echo $SEPARATOR
79+
echo "$SEPARATOR"
8080
echo " == Make sure the correct string (filename) is displayed when using -vvg"
8181
output="$($RMW_TEST_CMD_STRING -vvg)"
8282
echo $output
8383
cmp_substr "$output" "'read_only_file' will be purged in 90$(locale decimal_point)"
8484
cmp_substr "$output" "'topdir' will be purged in 90$(locale decimal_point)"
8585

86-
echo $SEPARATOR
86+
echo "$SEPARATOR"
8787
echo " == Empty works with force empty (-fe)"
8888
echo "y" | $RMW_TEST_CMD_STRING -v --empty -ff
89-
test ! -e $PRIMARY_WASTE_DIR/files/read_only_file
90-
test ! -e $PRIMARY_WASTE_DIR/files/topdir
91-
test ! -e $PRIMARY_WASTE_DIR/info/read_only_file.trashinfo
92-
test ! -e $PRIMARY_WASTE_DIR/info/topdir.trashinfo
89+
test ! -e "$PRIMARY_WASTE_DIR"/files/read_only_file
90+
test ! -e "$PRIMARY_WASTE_DIR"/files/topdir
91+
test ! -e "$PRIMARY_WASTE_DIR"/info/read_only_file.trashinfo
92+
test ! -e "$PRIMARY_WASTE_DIR"/info/topdir.trashinfo
9393

9494
echo " == Should work with 'Y' or 'y'"
9595
create_temp_files
96-
$RMW_TEST_CMD_STRING --verbose ${RMW_FAKE_HOME}/tmp-files/* && echo "y" | $RMW_TEST_CMD_STRING --empty
96+
$RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/tmp-files/* && echo "y" | $RMW_TEST_CMD_STRING --empty
9797

9898
create_temp_files
99-
$RMW_TEST_CMD_STRING --verbose ${RMW_FAKE_HOME}/tmp-files/*
100-
test -e $PRIMARY_WASTE_DIR/files/abc
101-
test -e $PRIMARY_WASTE_DIR/files/123
102-
test -e $PRIMARY_WASTE_DIR/files/xyz
99+
$RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/tmp-files/*
100+
test -e "$PRIMARY_WASTE_DIR"/files/abc
101+
test -e "$PRIMARY_WASTE_DIR"/files/123
102+
test -e "$PRIMARY_WASTE_DIR"/files/xyz
103103
echo "Y" | $RMW_TEST_CMD_STRING --empty
104104

105105
echo
106106
echo
107107
echo " == Test that the files are really gone"
108108

109-
test ! -e $PRIMARY_WASTE_DIR/files/abc
110-
test ! -e $PRIMARY_WASTE_DIR/info/abc.trashinfo
111-
test ! -e $PRIMARY_WASTE_DIR/files/123
112-
test ! -e $PRIMARY_WASTE_DIR/info/123.trashinfo
113-
test ! -e $PRIMARY_WASTE_DIR/files/xyz
114-
test ! -e $PRIMARY_WASTE_DIR/info/xyz.trashinfo
109+
test ! -e "$PRIMARY_WASTE_DIR"/files/abc
110+
test ! -e "$PRIMARY_WASTE_DIR"/info/abc.trashinfo
111+
test ! -e "$PRIMARY_WASTE_DIR"/files/123
112+
test ! -e "$PRIMARY_WASTE_DIR"/info/123.trashinfo
113+
test ! -e "$PRIMARY_WASTE_DIR"/files/xyz
114+
test ! -e "$PRIMARY_WASTE_DIR"/info/xyz.trashinfo
115115

116116
create_temp_files
117117

118-
cd ${RMW_FAKE_HOME}/..
118+
cd "${RMW_FAKE_HOME}"/..
119119
echo "\n\n == use a built-in environmental variable to write a"
120120
echo " == fake year to the .trashinfo files when running rmw"
121121
echo "-----------------------------------------------------\n"
122122

123-
RMW_FAKE_YEAR=true $RMW_TEST_CMD_STRING --verbose ${RMW_FAKE_HOME}/tmp-files/*
124-
cmp_substr "$(cat $PRIMARY_WASTE_DIR/info/abc.trashinfo)" \
123+
RMW_FAKE_YEAR=true $RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/tmp-files/*
124+
cmp_substr "$(cat "$PRIMARY_WASTE_DIR"/info/abc.trashinfo)" \
125125
"DeletionDate=1999"
126126

127127
echo
128128
echo
129129
echo " == The trashinfo records that these files were rmw'ed in 1999"
130130
echo " == So they will be purged now."
131131
$RMW_TEST_CMD_STRING --verbose --purge
132-
test ! -e $PRIMARY_WASTE_DIR/files/abc
133-
test ! -e $PRIMARY_WASTE_DIR/info/abc.trashinfo
134-
test ! -e $PRIMARY_WASTE_DIR/files/123
135-
test ! -e $PRIMARY_WASTE_DIR/info/123.trashinfo
136-
test ! -e $PRIMARY_WASTE_DIR/files/xyz
137-
test ! -e $PRIMARY_WASTE_DIR/info/xyz.trashinfo
132+
test ! -e "$PRIMARY_WASTE_DIR"/files/abc
133+
test ! -e "$PRIMARY_WASTE_DIR"/info/abc.trashinfo
134+
test ! -e "$PRIMARY_WASTE_DIR"/files/123
135+
test ! -e "$PRIMARY_WASTE_DIR"/info/123.trashinfo
136+
test ! -e "$PRIMARY_WASTE_DIR"/files/xyz
137+
test ! -e "$PRIMARY_WASTE_DIR"/info/xyz.trashinfo
138138

139139
echo
140140
echo
141141
echo " Creating some files for testing..."
142-
cd ${RMW_FAKE_HOME}
142+
cd "${RMW_FAKE_HOME}"
143143
create_some_files
144144

145-
echo $SEPARATOR
145+
echo "$SEPARATOR"
146146
echo " == rmw should be able to purge directories and subdirectories"
147147
echo " == even if some of the dirs are read-only"
148148

149-
echo $SEPARATOR
149+
echo "$SEPARATOR"
150150

151-
RMW_FAKE_YEAR=True $RMW_TEST_CMD_STRING --verbose ${RMW_FAKE_HOME}/somefiles
151+
RMW_FAKE_YEAR=True $RMW_TEST_CMD_STRING --verbose "${RMW_FAKE_HOME}"/somefiles
152152

153-
echo $SEPARATOR
153+
echo "$SEPARATOR"
154154
echo " == 1 f, this should pass"
155155
$RMW_TEST_CMD_STRING -f --purge
156156

157157
echo
158158
echo
159159
echo " == Show that the files are really gone"
160160

161-
test ! -e $PRIMARY_WASTE_DIR/files/somefiles
162-
test ! -e $PRIMARY_WASTE_DIR/info/somefiles.trashinfo
161+
test ! -e "$PRIMARY_WASTE_DIR"/files/somefiles
162+
test ! -e "$PRIMARY_WASTE_DIR"/info/somefiles.trashinfo
163163

164164
$RMW_TEST_CMD_STRING -o
165165

166166
echo " == Test 'show_purge_stats' == "
167167
create_temp_files
168-
RMW_FAKE_YEAR=True $RMW_TEST_CMD_STRING ${RMW_FAKE_HOME}/tmp-files/*
168+
RMW_FAKE_YEAR=True $RMW_TEST_CMD_STRING "${RMW_FAKE_HOME}"/tmp-files/*
169169
output=$($RMW_TEST_CMD_STRING -g)
170170
echo $output
171171
cmp_substr "$output" "Purging files based"

0 commit comments

Comments
 (0)