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-15 15:56:42 -0500
commit5f3b9de5178b6be3bb12390d5fb299594a757844 (patch)
tree5e6496b36b676f15a779a7ab1ee417c62790021e /makechrootpkg.in
parent05a65ee16dce078e87f5dba576d0d087e22c34d7 (diff)
makechrootpkg: _chrootbuild: Split into _chroot{prepare,build}.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in28
1 files changed, 26 insertions, 2 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 8e1fd95..67d2cf8 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -312,6 +312,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'
@@ -354,7 +360,7 @@ download_sources() {
rm -rf "$builddir"
}
-_chrootbuild() {
+_chrootprepare() {
# This function isn't run in makechrootpkg,
# so no global variables
@@ -392,7 +398,20 @@ _chrootbuild() {
exit 1
fi
- sudo -u builduser makepkg "$@"
+ sudo -u builduser makepkg "$@" --nobuild
+}
+
+_chrootbuild() {
+ # This function isn't run in makechrootpkg,
+ # so no global variables
+
+ . /etc/profile
+ export HOME=/build
+ shopt -s nullglob
+
+ cd /startdir
+
+ sudo -u builduser makepkg "$@" --noextract --noprepare
}
# Usage: move_products $copydir $owner
@@ -511,6 +530,11 @@ if arch-nspawn "$copydir" \
--bind-ro="$PWD:/startdir_host" \
--bind-ro="$SRCDEST:/srcdest_host" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
+ /chrootprepare "${makepkg_args[@]}" &&
+ arch-nspawn "$copydir" \
+ --bind-ro="$PWD:/startdir_host" \
+ --bind-ro="$SRCDEST:/srcdest_host" \
+ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
/chrootbuild "${makepkg_args[@]}"
then
move_products "$copydir" "$src_owner"