Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-02-15 15:56:42 -0500
committerLuke Shumaker <lukeshu@parabola.nu>2017-02-19 14:21:30 -0500
commit8ee94a8ff1be0a0247521d6cc2a5a5b1bdc1b78f (patch)
tree43f2a243c3a1a3ec6ce9a575a85c38996fd46158 /makechrootpkg.in
parent2fa58ec7710c9f08d1422ff223bc5276703905ab (diff)
makechrootpkg: _chrootbuild: Split into _chroot{prepare,build}.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in18
1 files changed, 17 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index f90e20d..3c80fb7 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -313,6 +313,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'
@@ -326,9 +332,14 @@ EOF
# These functions aren't run in makechrootpkg,
# so no global variables
+_chrootprepare() {
+ . /etc/profile
+ sudo -iu builduser bash -c 'cd /startdir; makepkg "$@" --nobuild' -bash "$@"
+}
+
_chrootbuild() {
. /etc/profile
- sudo -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
+ sudo -iu builduser bash -c 'cd /startdir; makepkg "$@" --noextract --noprepare' -bash "$@"
}
_chrootnamcap() {
@@ -481,6 +492,11 @@ if arch-nspawn "$copydir" \
--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"