diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-15 15:56:42 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-05-29 15:11:15 -0400 |
commit | ad54ac08ae475134f1ef6242cf4a831aa4ab770a (patch) | |
tree | a00ccb67e176be72bf46c4d163c4806d63078ce2 /makechrootpkg.in | |
parent | 01ea248b5a24f18f092c67f3b2e625d1affa33f3 (diff) | |
download | devtools-ad54ac08ae475134f1ef6242cf4a831aa4ab770a.tar.xz |
makechrootpkg: _chrootbuild: Split into _chroot{prepare,build}
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r-- | makechrootpkg.in | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in index 37e97e7..8480c56 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -200,6 +200,12 @@ EOF # working copy { printf '#!/bin/bash\n' + declare -f _chrootprepare + printf '_chrootprepare "$@"\n' + } > "$copydir/chrootprepare" + chmod +x "$copydir/chrootprepare" + { + printf '#!/bin/bash\n' declare -f _chrootbuild declare -p SOURCE_DATE_EPOCH 2>/dev/null || true printf '_chrootbuild "$@" || exit\n' @@ -214,6 +220,20 @@ EOF # These functions aren't run in makechrootpkg, # so no global variables +_chrootprepare() { + # No coredumps + ulimit -c 0 + + # shellcheck source=/dev/null + . /etc/profile + + # 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 --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd /startdir; makepkg "$@" --nobuild' -bash "$@" +} + _chrootbuild() { # No coredumps ulimit -c 0 @@ -225,7 +245,7 @@ _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 -iu builduser bash -c 'cd /startdir; makepkg "$@" --noextract --noprepare' -bash "$@" } _chrootnamcap() { @@ -412,6 +432,11 @@ main() { --bind="$PWD:/startdir" \ --bind="$SRCDEST:/srcdest" \ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ + /chrootprepare "${makepkg_args[@]}" && + arch-nspawn "$copydir" \ + --bind="$PWD:/startdir" \ + --bind="$SRCDEST:/srcdest" \ + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ /chrootbuild "${makepkg_args[@]}" then move_products "$copydir" "$src_owner" |