diff options
Diffstat (limited to 'bin/buildpackage.sh')
-rwxr-xr-x | bin/buildpackage.sh | 20 |
1 files changed, 14 insertions, 6 deletions
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")" |