index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-15 15:56:42 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2017-04-20 00:23:50 -0400 |
commit | 86a56039866bf42fb4304cc19b0b29e496ae1338 (patch) | |
tree | ab4859ab41d5706ae2e442763f4490ff3138c4fa /makechrootpkg.in | |
parent | fbaf055441b7df0f6593798d7dfd4ff9e2ae7680 (diff) |
-rw-r--r-- | makechrootpkg.in | 19 |
diff --git a/makechrootpkg.in b/makechrootpkg.in index bb7253e..c0aee24 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -227,6 +227,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 printf '_chrootbuild "$@" || exit\n' @@ -240,10 +246,16 @@ EOF # These functions aren't run in makechrootpkg, # so no global variables +_chrootprepare() { + # shellcheck source=/dev/null + . /etc/profile + sudo -iu builduser bash -c 'cd /startdir; makepkg "$@" --nobuild' -bash "$@" +} + _chrootbuild() { # shellcheck source=/dev/null . /etc/profile - sudo -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@" + sudo -iu builduser bash -c 'cd /startdir; makepkg "$@" --noextract --noprepare' -bash "$@" } _chrootnamcap() { @@ -405,6 +417,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" |