summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chroot-tools/libremakepkg17
-rw-r--r--src/chroot-tools/makechrootpkg.sh.patch27
2 files changed, 22 insertions, 22 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index a459009..26080bc 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -121,21 +121,22 @@ build() (
local copydir=$1; shift
local repack=$1; shift
- local run=()
+ local run_ynet=()
+ local run_nnet=()
if $INCHROOT; then
- run=(unshare)
- if $NONET; then run+=('-n'); fi
+ run_ynet=(unshare)
+ run_nnet=(unshare -n)
else
- run=(librechroot "${librechroot_flags[@]}")
- if $NONET; then run+=('-N'); fi
- run+=(run)
+ run_ynet=(librechroot "${librechroot_flags[@]}" run)
+ run_nnet=(librechroot "${librechroot_flags[@]}" -N run)
fi
+ $NONET || run_nnet=("${run_ynet[@]}")
prepare_chroot "$copydir" "$LIBREHOME" "$repack" false
- "${run[@]}" /chrootprepare "$@" |& indent
+ "${run_ynet[@]}" /chrootprepare false "$@" |& indent
run_hook pre_build "$copydir"
trap "run_hook post_build '$copydir'" EXIT
- "${run[@]}" /chrootbuild "$@" |& indent
+ "${run_nnet[@]}" /chrootbuild false "$@" |& indent
)
# The main program #############################################################
diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch
index d6c96f9..817eaa5 100644
--- a/src/chroot-tools/makechrootpkg.sh.patch
+++ b/src/chroot-tools/makechrootpkg.sh.patch
@@ -1,5 +1,5 @@
--- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500
-+++ makechrootpkg.sh.ugly 2014-01-05 18:52:41.624501065 -0500
++++ makechrootpkg.sh.ugly 2014-02-05 19:01:17.583560384 -0500
@@ -12,6 +12,7 @@
shopt -s nullglob
@@ -206,7 +206,7 @@
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o
else
( export SRCDEST BUILDDIR="$builddir"
-@@ -277,20 +331,18 @@
+@@ -277,10 +331,10 @@
(( $? != 0 )) && die "Could not download sources."
# Clean up garbage from verifysource
@@ -218,11 +218,8 @@
+_chrootprepare() {
# This function isn't run in makechrootpkg,
# so no global variables
-- local run_namcap="$1"; shift
-- local makepkg_args=("$@")
--
- . /etc/profile
- export HOME=/build
+ local run_namcap="$1"; shift
+@@ -291,6 +345,7 @@
shopt -s nullglob
# XXX: Workaround makepkg disliking read-only dirs
@@ -230,10 +227,12 @@
ln -sft /srcdest /srcdest_host/*
ln -sft /startdir /startdir_host/*
-@@ -313,9 +365,23 @@
- rm PKGBUILD*
+@@ -314,8 +369,25 @@
cp /startdir_host/PKGBUILD* .
chown nobody PKGBUILD*
+
++ # Sync deps now, as networking may be disabled during _chrootbuild
++ sudo -u nobody makepkg "${makepkg_args[@]}" -eo
+}
+
+_chrootbuild() {
@@ -247,14 +246,14 @@
+ shopt -s nullglob
+
+ cd /startdir
-
++
# Safety check
if [[ ! -w PKGBUILD ]]; then
+ # XXX: internationalize this message
echo "Can't write to PKGBUILD!"
exit 1
fi
-@@ -333,12 +399,24 @@
+@@ -333,12 +405,24 @@
exit 0
}
@@ -279,7 +278,7 @@
for l in "$copydir"/logdest/*; do
[[ $l == */logpipe.* ]] && continue
chown "$src_owner" "$l"
-@@ -352,6 +430,10 @@
+@@ -352,6 +436,10 @@
}
# }}}
@@ -290,7 +289,7 @@
umask 0022
load_vars /etc/makepkg.conf
-@@ -363,30 +445,45 @@
+@@ -363,30 +451,45 @@
[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD
[[ -d $LOGDEST ]] || LOGDEST=$PWD
@@ -342,7 +341,7 @@
if (( ret != 0 )); then
if $temp_chroot; then
-@@ -397,3 +494,4 @@
+@@ -397,3 +500,4 @@
else
true
fi