summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2021-06-21 20:46:16 +0200
committerLevente Polyak <anthraxx@archlinux.org>2021-07-17 22:56:11 +0200
commit0a0e66a784d4831c4139bf646b5329bff54465d7 (patch)
tree10c0aae49fcd0c08fb999a35c0d3933e4a73d524 /makechrootpkg.in
parent60e96c9d4bc22062f4633fbc1faa57a2947d0605 (diff)
downloaddevtools-0a0e66a784d4831c4139bf646b5329bff54465d7.tar.xz
feat: support exposing buildtool to aid reproducible builds configs
This helps to map the correct build tool configs that are required to reproduce a specific package and have the appropriate *FLAGS etc.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index d308af2..dddfca9 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -190,6 +190,8 @@ EOF
printf '#!/bin/bash\n'
declare -f _chrootbuild
declare -p SOURCE_DATE_EPOCH 2>/dev/null || true
+ declare -p BUILDTOOL 2>/dev/null
+ declare -p BUILDTOOLVER 2>/dev/null
printf '_chrootbuild "$@" || exit\n'
if (( run_namcap )); then
@@ -213,7 +215,10 @@ _chrootbuild() {
# 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 --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
+ sudo --preserve-env=SOURCE_DATE_EPOCH \
+ --preserve-env=BUILDTOOL \
+ --preserve-env=BUILDTOOLVER \
+ -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
ret=$?
case $ret in
0|14)
@@ -298,7 +303,7 @@ done
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
-check_root SOURCE_DATE_EPOCH,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
+check_root SOURCE_DATE_EPOCH,BUILDTOOL,BUILDTOOLVER,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
# Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$passeddir")