summaryrefslogtreecommitdiff
path: root/src/makechrootpkg.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/makechrootpkg.in')
-rw-r--r--src/makechrootpkg.in16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/makechrootpkg.in b/src/makechrootpkg.in
index 14b8f11..44b991b 100644
--- a/src/makechrootpkg.in
+++ b/src/makechrootpkg.in
@@ -182,6 +182,9 @@ prepare_chroot() {
grep -q "^$x" "$copydir/etc/makepkg.conf" && continue
echo "$x" >>"$copydir/etc/makepkg.conf"
done
+ if [ -n "${PKGEXT}" ]; then
+ sed -i 's/^PKGEXT=.*/PKGEXT='"'${PKGEXT}'"'/' "$copydir/etc/makepkg.conf"
+ fi
cat > "$copydir/etc/sudoers.d/builduser-pacman" <<EOF
builduser ALL = NOPASSWD: /usr/bin/pacman
@@ -215,6 +218,9 @@ _chrootbuild() {
# shellcheck source=/dev/null
. /etc/profile
+ # otherwise we might have missing keys
+ pacman-key --populate
+
# 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.
@@ -222,7 +228,7 @@ _chrootbuild() {
sudo --preserve-env=SOURCE_DATE_EPOCH \
--preserve-env=BUILDTOOL \
--preserve-env=BUILDTOOLVER \
- -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
+ -iu builduser bash -c 'cd /startdir; GIT_TERMINAL_PROMPT=0 CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse makepkg "$@"' -bash "$@"
ret=$?
case $ret in
0|14)
@@ -234,7 +240,10 @@ _chrootbuild() {
_chrootnamcap() {
pacman -S --needed --noconfirm namcap
- for pkgfile in /startdir/PKGBUILD /pkgdest/*; do
+ for pkgfile in /startdir/PKGBUILD /startdir/*.pkg.tar.xz /pkgdest/*; do
+ if [ ! -f "${pkgfile}" ]; then
+ continue
+ fi
echo "Checking ${pkgfile##*/}"
sudo -u builduser namcap "$pkgfile" 2>&1 | tee "/logdest/${pkgfile##*/}-namcap.log"
done
@@ -247,7 +256,7 @@ download_sources() {
# Ensure sources are downloaded
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME,SSH_AUTH_SOCK \
env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \
- makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o "${verifysource_args[@]}" ||
+ GIT_TERMINAL_PROMPT=0 makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o "${verifysource_args[@]}" ||
die "Could not download sources."
}
@@ -342,6 +351,7 @@ done
umask 0022
ORIG_HOME=$HOME
+PKGEXT=$PKGEXT
IFS=: read -r _ _ _ _ _ HOME _ < <(getent passwd "${SUDO_USER:-$USER}")
load_makepkg_config
HOME=$ORIG_HOME