Browse Source

create_package.sh: quote variables

pull/123/head
Reynir Björnsson 2 months ago
parent
commit
932b0c963e
  1. 16
      packaging/FreeBSD/create_package.sh
  2. 18
      packaging/debian/create_package.sh

16
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"

18
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"

Loading…
Cancel
Save