summaryrefslogtreecommitdiff
path: root/src/chroot-tools/makechrootpkg.sh.patch
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-14 14:14:20 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-14 14:14:20 -0400
commit564a4cfa06a8a1cf880583669cc578f8cc45dc44 (patch)
treebe5c9eff2d0c96fff6a8f956e47f6e5e7821f210 /src/chroot-tools/makechrootpkg.sh.patch
parent6556108c9d8a4d93f482f84c8321bda9565eac37 (diff)
libremakepkg: add a librechroot_flags variable, split chrootbuild up
We split chrootbuild so that the initialization bit runs before hook_pre_build.
Diffstat (limited to 'src/chroot-tools/makechrootpkg.sh.patch')
-rw-r--r--src/chroot-tools/makechrootpkg.sh.patch68
1 files changed, 56 insertions, 12 deletions
diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch
index f5b8ed7..275b88a 100644
--- a/src/chroot-tools/makechrootpkg.sh.patch
+++ b/src/chroot-tools/makechrootpkg.sh.patch
@@ -1,5 +1,5 @@
---- makechrootpkg.sh.in 2013-09-08 23:01:20.000000000 -0400
-+++ makechrootpkg.sh.ugly 2013-09-09 15:43:06.000000000 -0400
+--- makechrootpkg.sh.in 2013-09-12 10:02:36.000000000 -0400
++++ makechrootpkg.sh.ugly 2013-09-14 13:51:51.000000000 -0400
@@ -12,6 +12,7 @@
shopt -s nullglob
@@ -162,7 +162,7 @@
sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf"
echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf"
fi
-@@ -235,6 +270,14 @@
+@@ -235,20 +270,37 @@
chmod 440 "$copydir/etc/sudoers.d/nobody-pacman"
fi
@@ -176,8 +176,12 @@
+
# This is a little gross, but this way the script is recreated every time in the
# working copy
- printf $'#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \
-@@ -242,13 +285,19 @@
+- printf $'#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \
++ printf '#!/bin/bash\n%s\n_chrootprepare "$@"' "$(declare -f _chrootprepare)" \
++ > "$copydir/chrootprepare"
++ chmod +x "$copydir/chrootprepare"
++ printf '#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \
+ "$run_namcap" >"$copydir/chrootbuild"
chmod +x "$copydir/chrootbuild"
}
@@ -199,7 +203,7 @@
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o
else
( export SRCDEST BUILDDIR="$builddir"
-@@ -258,7 +307,7 @@
+@@ -258,20 +310,15 @@
(( $? != 0 )) && die "Could not download sources."
# Clean up garbage from verifysource
@@ -207,8 +211,48 @@
+ rm -rf "$builddir"
}
- _chrootbuild() {
-@@ -295,6 +344,7 @@
+-_chrootbuild() {
++_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
+- shopt -s nullglob
+
+ # XXX: Workaround makepkg disliking read-only dirs
++ rm -rf -- /srcdest/* /startdir/*
+ ln -sft /srcdest /srcdest_host/*
+ ln -sft /startdir /startdir_host/*
+
+@@ -286,15 +333,27 @@
+ done
+ done
+
+- cd /startdir
+-
+ # XXX: Keep PKGBUILD writable for pkgver()
+- rm PKGBUILD*
+- cp /startdir_host/PKGBUILD* .
+- chown nobody PKGBUILD*
++ rm /startdir/PKGBUILD*
++ cp /startdir_host/PKGBUILD* /startdir
++ chown nobody /startdir/PKGBUILD*
++}
++
++_chrootbuild() {
++ # This function isn't run in makechrootpkg,
++ # so no global variables
++ local run_namcap="$1"; shift
++ local makepkg_args=("$@")
++
++ . /etc/profile
++ export HOME=/build
++ shopt -s nullglob
++
++ cd /startdir
# Safety check
if [[ ! -w PKGBUILD ]]; then
@@ -216,7 +260,7 @@
echo "Can't write to PKGBUILD!"
exit 1
fi
-@@ -312,12 +362,24 @@
+@@ -312,12 +371,24 @@
exit 0
}
@@ -241,7 +285,7 @@
for l in "$copydir"/logdest/*; do
chown "$src_owner" "$l"
mv "$l" "$LOGDEST"
-@@ -325,6 +387,10 @@
+@@ -325,6 +396,10 @@
}
# }}}
@@ -252,7 +296,7 @@
umask 0022
load_vars /etc/makepkg.conf
-@@ -335,27 +401,37 @@
+@@ -335,27 +410,37 @@
[[ -d $SRCDEST ]] || SRCDEST=$PWD
[[ -d $LOGDEST ]] || LOGDEST=$PWD
@@ -296,7 +340,7 @@
if (( ret != 0 )); then
if $temp_chroot; then
-@@ -366,3 +442,4 @@
+@@ -366,3 +451,4 @@
else
true
fi