From 1cb62685afe79e7d3ab5c38b1ff6900c587f96d3 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 11 Nov 2022 00:18:46 +0100 Subject: more working --- bin/buildpackage.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'bin/buildpackage.sh') diff --git a/bin/buildpackage.sh b/bin/buildpackage.sh index 4be1b3a..ace52fd 100755 --- a/bin/buildpackage.sh +++ b/bin/buildpackage.sh @@ -1,18 +1,26 @@ #!/bin/bash echo "BUILDING: $PACKAGE_NAME" -echo "Build Deps: $BUILD_ALL_AUR_DEPENDS" +echo "PACKAGER: $PACKAGER" cd /workdir || exit 1 -while read NAME BASE VER _; do - echo $NAME $BASE $VER +while read -r NAME BASE VER _; do + echo "$NAME $VER for $ARCH" + OUTNAME="$NAME-$VER-$ARCH.pkg" + + # Only build when needed + if [ ! "$FORCE_REBUILD" = "yes" ] && compgen -G "/pkgout/${OUTNAME}*"; then + echo "$NAME $VER ($ARCH) is already built. Skipping." + continue + fi sudo -u aurbuilder git clone "https://aur.archlinux.org/$BASE.git" "$BASE" cd "$BASE" || exit 1 - # TODO: PKGDEST instead of copy - sudo -u aurbuilder makepkg --syncdeps --noconfirm --install + sudo -u aurbuilder CARCH="$ARCH" PACKAGER="$PACKAGER" PKGDEST="/pkgout/" \ + makepkg --force --syncdeps --noconfirm --install - cp ./*.pkg.tar.zst /pkgout + #cp ./*.pkg.tar.zst /pkgout + test -n "$CHOWN" && sudo chown "$CHOWN" "/pkgout/${OUTNAME}"* done <<< "$(getpackage.py "$PACKAGE_NAME")" -- cgit v1.2.3