d/shuffle-boot-files: The Great Quotification
authorElliott Mitchell <ehem+debian@m5p.com>
Fri, 17 Jul 2020 19:05:25 +0000 (12:05 -0700)
committerHans van Kranenburg <hans@knorrie.org>
Fri, 26 Feb 2021 19:10:29 +0000 (20:10 +0100)
These should originate with the owner of a build system and are unlikely
to get hazardous values.  This script though *should* work on a system
with such a bizzare setup.  On general principle, add lots of double-quotes.

Signed-off-by: Elliott Mitchell <ehem+debian@m5p.com>
Acked-by: Hans van Kranenburg <hans@knorrie.org>
debian/shuffle-boot-files

index f7492c0c726bd7e07af0216ebe6ea95ab6345c89..683788d40ad951a4efb7e9b5578d8fcef1d67306 100755 (executable)
@@ -2,13 +2,13 @@
 
 set -e
 
-version=$1; shift
-flavour=$1; shift
+version="$1"; shift
+flavour="$1"; shift
 t=debian/tmp
 
-hv=xen-hypervisor-$version-$flavour
-dest=debian/$hv/boot
-mkdir -p $dest
+hv="xen-hypervisor-$version-$flavour"
+dest="debian/$hv/boot"
+mkdir -p "$dest"
 
 # The upstream build system puts a pile of needless symlinks in /boot.
 #
@@ -21,11 +21,11 @@ mkdir -p $dest
 # more useful when the -i386 flavour existed and was coinstallable
 # with the -amd64 flavour.)
 
-verstring=$(readlink debian/tmp/boot/xen.gz ||
-            readlink debian/tmp/boot/xen)
-verstring=${verstring##*/}
-verstring=${verstring%.gz}
+verstring="$(readlink debian/tmp/boot/xen.gz ||
+            readlink debian/tmp/boot/xen)"
+verstring="${verstring##*/}"
+verstring="${verstring%.gz}"
 
-for f in `cd $t/boot && find * -type f -print`; do
-       cp -v $t/boot/$f $dest/${f/$verstring/xen-$version-$flavour}
+for f in `cd "$t/boot" && find * -type f -print`; do
+       cp -v "$t/boot/$f" "$dest/${f/$verstring/xen-$version-$flavour}"
 done