[LEDE-DEV] [PATCH v3 07/13] scripts: Quote to prevent word splitting
Jan-Tarek Butt
tarek at ring0.de
Thu Oct 6 01:50:34 PDT 2016
Signed-off-by: Jan-Tarek Butt <tarek at ring0.de>
---
scripts/combined-ext-image.sh | 2 +-
scripts/combined-image.sh | 2 +-
scripts/ext-toolchain.sh | 8 ++++----
scripts/strip-kmod.sh | 1 +
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/scripts/combined-ext-image.sh b/scripts/combined-ext-image.sh
index c01cf40..cf0ba2d 100755
--- a/scripts/combined-ext-image.sh
+++ b/scripts/combined-ext-image.sh
@@ -48,7 +48,7 @@ while [ "$#" -gt 1 ]
[ ! -f "$file" ] && echo "$ME: Not a valid file: $file" && usage
FILES="$FILES $file"
md5=$(cat "$file" | md5sum -)
- printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> "$IMG_OUT"
+ printf "%-32s%08x%32s" "$filename" "$(stat -c "%s" "$file")" "${md5%% *}" >> "$IMG_OUT"
shift 2
done
diff --git a/scripts/combined-image.sh b/scripts/combined-image.sh
index 1eb0d95..6e2cf38 100644
--- a/scripts/combined-image.sh
+++ b/scripts/combined-image.sh
@@ -25,7 +25,7 @@ md5=$(cat "$kern" "$root" | md5sum -)
# <rootfs length> length of rootfs encoded as zero padded 8 digit hex
# <md5sum> checksum of the combined kernel and rootfs image
( printf "CI%08x%08x%32s" \
- $(stat -c "%s" "$kern") $(stat -c "%s" "$root") "${md5%% *}" | \
+ "$(stat -c "%s" "$kern")" "$(stat -c "%s" "$root")" "${md5%% *}" | \
dd bs=$BLKSZ conv=sync;
cat "$kern" "$root"
) > "${IMAGE}" 2>/dev/null
diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh
index b180874..eec5a94 100755
--- a/scripts/ext-toolchain.sh
+++ b/scripts/ext-toolchain.sh
@@ -497,8 +497,8 @@ while [ -n "$1" ]; do
--print-bin)
if [ -z "$1" ]; then
- echo "Available programs:" >&2
- echo $(echo "$BIN_SPECS" | sed -ne 's#:.*$##p') >&2
+ echo "Available programs:" >&2
+ echo "$(echo "$BIN_SPECS" | sed -ne 's#:.*$##p')" >&2
exit 1
fi
@@ -508,8 +508,8 @@ while [ -n "$1" ]; do
--print-libs)
if [ -z "$1" ]; then
- echo "Available libraries:" >&2
- echo $(echo "$LIB_SPECS" | sed -ne 's#:.*$##p') >&2
+ echo "Available libraries:" >&2
+ echo "$(echo "$LIB_SPECS" | sed -ne 's#:.*$##p')" >&2
exit 1
fi
diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh
index 5a43ed5..c56b8a5 100755
--- a/scripts/strip-kmod.sh
+++ b/scripts/strip-kmod.sh
@@ -51,6 +51,7 @@ $3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ && !def[$3] {
}
' > "$MODULE.tmp1"
+# shellcheck disable=SC2046
"${CROSS}"objcopy `cat "${MODULE}".tmp1` "${MODULE}".tmp "${MODULE}".out
mv "${MODULE}.out" "${MODULE}"
rm -f "${MODULE}".t*
--
2.10.0
More information about the Lede-dev
mailing list