summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-04-20 13:49:19 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:31:18 -0400
commitdd21fbf3c7cdbd77e2d1fa11b1153d55ccb0292a (patch)
tree675a0c286c37103813c435aeb42aa19d02a10d12
parent76f9c4155feb562e94b9b96c081153be77a32319 (diff)
downloaddevtools32-dd21fbf3c7cdbd77e2d1fa11b1153d55ccb0292a.tar.xz
makechrootpkg: Also build --allsource packages.
It also sets SRCEXT="-$pkgarch$SRCEXT", so that two runs of makechrootpkg on different architectures don't overwrite eachothers source packages.
-rw-r--r--makechrootpkg.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index a4dbbfb..7589737 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -272,10 +272,24 @@ _chrootprepare() {
_chrootbuild() {
# shellcheck source=/dev/null
. /etc/profile
+ local srcext
+ srcext="$(
+ # shellcheck source=makepkg-x86_64.conf
+ . /etc/makepkg.conf || exit
+ # shellcheck source=PKGBUILD.proto
+ . /startdir/PKGBUILD || exit
+ if [ "$arch" = any ]; then
+ pkgarch=any
+ else
+ pkgarch=$CARCH
+ fi
+ printf '%s\n' "-$pkgarch$SRCEXT"
+ )" || return
# Beware, there are some stupid arbitrary rules on how you can
# use "$" in arguments to commands with "sudo -i". ${foo} or
# ${1} is OK, but $foo or $1 isn't.
# https://bugzilla.sudo.ws/show_bug.cgi?id=765
+ sudo -iu builduser bash -c 'cd /startdir; SRCEXT="${1}" makepkg "${@:2}" --allsource' -bash "$srcext" "$@" || return
sudo -iu builduser bash -c 'cd /startdir; makepkg "$@" --noextract --noprepare' -bash "$@"
}