create_package.sh: quote variables

This commit is contained in:
Reynir Björnsson 2022-06-22 12:37:57 +02:00
parent bac3b3c64b
commit 932b0c963e
2 changed files with 17 additions and 17 deletions

View file

@ -24,13 +24,13 @@ trap 'rm -rf $tmpd' 0 INT EXIT
mkdir -p "$sbindir" "$libexecdir" "$rcdir" mkdir -p "$sbindir" "$libexecdir" "$rcdir"
# stage service scripts # 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 # 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-migrations" "$sbindir/builder-migrations"
install -U $bdir/builder-db $sbindir/builder-db install -U "$bdir/builder-db" "$sbindir/builder-db"
# create +MANIFEST # create +MANIFEST
flatsize=$(find "$rootdir" -type f -exec stat -f %z {} + | 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" } | sed -e "s:${rootdir}::" >> "$manifest"
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct) export SOURCE_DATE_EPOCH=$(git log -1 --pretty=format:%ct)
pkg create -r "$rootdir" -M "$manifest" -o $basedir/ pkg create -r "$rootdir" -M "$manifest" -o "$basedir/"
mv $basedir/builder-web-*.pkg $basedir/builder-web.pkg mv "$basedir/builder-web-*.pkg" "$basedir/builder-web.pkg"
echo 'bin: [ "builder-web.pkg" ]' > $basedir/builder-web.install echo 'bin: [ "builder-web.pkg" ]' > "$basedir/builder-web.install"
echo 'doc: [ "README.md" ]' >> $basedir/builder-web.install echo 'doc: [ "README.md" ]' >> "$basedir/builder-web.install"

View file

@ -26,17 +26,17 @@ install "$bdir/builder-migrations" "$sbindir/builder-migrations"
install "$bdir/builder-db" "$sbindir/builder-db" install "$bdir/builder-db" "$sbindir/builder-db"
# service script # 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 debian metadata
install -m 0644 $basedir/packaging/debian/control $debiandir/control install -m 0644 "$basedir/packaging/debian/control" "$debiandir/control"
install -m 0644 $basedir/packaging/debian/changelog $debiandir/changelog install -m 0644 "$basedir/packaging/debian/changelog" "$debiandir/changelog"
install -m 0644 $basedir/packaging/debian/copyright $debiandir/copyright install -m 0644 "$basedir/packaging/debian/copyright" "$debiandir/copyright"
install $basedir/packaging/debian/postinst $debiandir/postinst install "$basedir/packaging/debian/postinst" "$debiandir/postinst"
ARCH=$(dpkg-architecture -q DEB_TARGET_ARCH) 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 dpkg-deb --build "$rootdir" "$basedir/builder-web.deb"
echo 'bin: [ "builder-web.deb" ]' > $basedir/builder-web.install echo 'bin: [ "builder-web.deb" ]' > "$basedir/builder-web.install"
echo 'doc: [ "README.md" ]' >> $basedir/builder-web.install echo 'doc: [ "README.md" ]' >> "$basedir/builder-web.install"