xxdist: add install functionality

This commit is contained in:
Joel Beckmeyer 2024-05-01 09:31:41 -04:00
parent 957b150359
commit 9b9b76cb2c

View File

@ -1,17 +1,39 @@
#!/bin/sh #!/bin/sh
branch_name="$(git branch --show-current)" branch_name="$(git branch --show-current)"
targets=""
install=false
distribute() {
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" "$1":
}
install() {
package_dir=$(basename "$branch_name")
ssh "$1" "xi -R $package_dir -Suy && rm -rf $package_dir"
}
if [ "$1" = "-i" ]; then
install=true
shift
fi
if [ $# = 0 ]; then if [ $# = 0 ]; then
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" daybreak: targets="daybreak epoch"
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" epoch:
elif [ "$1" = "repo" ]; then elif [ "$1" = "repo" ]; then
cd "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" cd "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" || exit 1
for p in *.xbps; do for p in *.xbps; do
rsync -P $p daybreak:/srv/repo rsync -P "$p" daybreak:/srv/repo
ssh daybreak "xbps-rindex --add /srv/repo/$p; ssh daybreak "xbps-rindex --add /srv/repo/$p;
xbps-rindex --privkey /srv/repo/private.pem --sign-pkg /srv/repo/*.xbps" xbps-rindex --privkey /srv/repo/private.pem --sign-pkg /srv/repo/*.xbps"
done done
else else
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" "$1": targets="$1"
fi fi
for t in $targets; do
distribute "$t"
if [ "$install" = true ]; then
install "$t"
fi
done