From 932b0c963e230b01fd76e36252affbd32f33338d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 22 Jun 2022 12:37:57 +0200 Subject: [PATCH] create_package.sh: quote variables --- packaging/FreeBSD/create_package.sh | 16 ++++++++-------- packaging/debian/create_package.sh | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packaging/FreeBSD/create_package.sh b/packaging/FreeBSD/create_package.sh index 1d0a956..012dff0 100755 --- a/packaging/FreeBSD/create_package.sh +++ b/packaging/FreeBSD/create_package.sh @@ -24,13 +24,13 @@ trap 'rm -rf $tmpd' 0 INT EXIT mkdir -p "$sbindir" "$libexecdir" "$rcdir" # stage service scripts -install -U $pdir/rc.d/builder_web $rcdir/builder_web +install -U "$pdir/rc.d/builder_web" "$rcdir/builder_web" # stage app binaries -install -U $bdir/builder-web $libexecdir/builder-web +install -U "$bdir/builder-web" "$libexecdir/builder-web" -install -U $bdir/builder-migrations $sbindir/builder-migrations -install -U $bdir/builder-db $sbindir/builder-db +install -U "$bdir/builder-migrations" "$sbindir/builder-migrations" +install -U "$bdir/builder-db" "$sbindir/builder-db" # create +MANIFEST flatsize=$(find "$rootdir" -type f -exec stat -f %z {} + | @@ -48,7 +48,7 @@ sed -e "s:%%FLATSIZE%%:${flatsize}:" -e "/^[Vv]ersion:/s/-/./g" "$pdir/MANIFEST" } | sed -e "s:${rootdir}::" >> "$manifest" export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct) -pkg create -r "$rootdir" -M "$manifest" -o $basedir/ -mv $basedir/builder-web-*.pkg $basedir/builder-web.pkg -echo 'bin: [ "builder-web.pkg" ]' > $basedir/builder-web.install -echo 'doc: [ "README.md" ]' >> $basedir/builder-web.install +pkg create -r "$rootdir" -M "$manifest" -o "$basedir/" +mv "$basedir/builder-web-*.pkg" "$basedir/builder-web.pkg" +echo 'bin: [ "builder-web.pkg" ]' > "$basedir/builder-web.install" +echo 'doc: [ "README.md" ]' >> "$basedir/builder-web.install" diff --git a/packaging/debian/create_package.sh b/packaging/debian/create_package.sh index d8d48d7..773f9a9 100755 --- a/packaging/debian/create_package.sh +++ b/packaging/debian/create_package.sh @@ -26,17 +26,17 @@ install "$bdir/builder-migrations" "$sbindir/builder-migrations" install "$bdir/builder-db" "$sbindir/builder-db" # service script -install -m 0644 $basedir/packaging/debian/builder-web.service $systemddir/builder-web.service +install -m 0644 "$basedir/packaging/debian/builder-web.service" "$systemddir/builder-web.service" # install debian metadata -install -m 0644 $basedir/packaging/debian/control $debiandir/control -install -m 0644 $basedir/packaging/debian/changelog $debiandir/changelog -install -m 0644 $basedir/packaging/debian/copyright $debiandir/copyright -install $basedir/packaging/debian/postinst $debiandir/postinst +install -m 0644 "$basedir/packaging/debian/control" "$debiandir/control" +install -m 0644 "$basedir/packaging/debian/changelog" "$debiandir/changelog" +install -m 0644 "$basedir/packaging/debian/copyright" "$debiandir/copyright" +install "$basedir/packaging/debian/postinst" "$debiandir/postinst" ARCH=$(dpkg-architecture -q DEB_TARGET_ARCH) -sed -i -e "s/^Architecture:.*/Architecture: ${ARCH}/" $debiandir/control +sed -i -e "s/^Architecture:.*/Architecture: ${ARCH}/" "$debiandir/control" -dpkg-deb --build $rootdir $basedir/builder-web.deb -echo 'bin: [ "builder-web.deb" ]' > $basedir/builder-web.install -echo 'doc: [ "README.md" ]' >> $basedir/builder-web.install +dpkg-deb --build "$rootdir" "$basedir/builder-web.deb" +echo 'bin: [ "builder-web.deb" ]' > "$basedir/builder-web.install" +echo 'doc: [ "README.md" ]' >> "$basedir/builder-web.install"