summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-13 12:28:34 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-13 12:28:34 -0400
commite08875e4e21bca8a5309f039f3a32a86adda88fe (patch)
tree324417f9a92ed581cd695e434d655fa4c90b1193
parentea1c88c01f51ef776e7ca135b5478eeee7aed742 (diff)
makechrootpkg.sh.patch: Update to newer devtools
-rw-r--r--src/chroot-tools/makechrootpkg.sh.patch62
1 files changed, 17 insertions, 45 deletions
diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch
index ae22e0c..a17b2d3 100644
--- a/src/chroot-tools/makechrootpkg.sh.patch
+++ b/src/chroot-tools/makechrootpkg.sh.patch
@@ -1,5 +1,5 @@
---- makechrootpkg.sh.in 2015-01-01 16:44:06.432049525 -0500
-+++ makechrootpkg.sh.ugly 2015-01-01 22:20:08.269220861 -0500
+--- makechrootpkg.sh.in 2015-04-13 12:25:34.551599741 -0400
++++ makechrootpkg.sh.ugly 2015-04-13 12:25:34.574932652 -0400
@@ -1,4 +1,6 @@
#!/bin/bash
+# License: GNU GPLv2
@@ -27,36 +27,9 @@
usage() {
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
-@@ -67,6 +71,7 @@
- exit 1
+@@ -68,28 +72,46 @@
}
-+parse_options_init() {
- orig_argv=("$@")
-
- while getopts 'hcur:I:l:nTD:d:' arg; do
-@@ -93,9 +98,6 @@
- [[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"
- [[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"
-
--# Detect chrootdir filesystem type
--chroottype=$(stat -f -c %T "$chrootdir")
--
- if [[ ${copy:0:1} = / ]]; then
- copydir=$copy
- else
-@@ -115,35 +117,54 @@
- esac
- done
-
--if [[ -n $SUDO_USER ]]; then
-+if [[ -n ${SUDO_USER:-} ]]; then
- eval "USER_HOME=~$SUDO_USER"
- else
- USER_HOME=$HOME
- fi
-+}
-
# {{{ functions
+# Usage: load_vars $makepkg_conf
+# Globals:
@@ -108,7 +81,7 @@
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then
if [[ -d $copydir ]]; then
btrfs subvolume delete "$copydir" >/dev/null ||
-@@ -159,14 +180,18 @@
+@@ -105,14 +127,18 @@
# Drop the read lock again
lock_close 8
@@ -130,7 +103,7 @@
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then
btrfs subvolume delete "$copydir" >/dev/null ||
die "Unable to delete subvolume %s" "$copydir"
-@@ -181,9 +206,14 @@
+@@ -127,9 +153,14 @@
stat_done
}
@@ -145,7 +118,7 @@
for install_pkg in "${install_pkgs[@]}"; do
pkgname="${install_pkg##*/}"
cp "$install_pkg" "$copydir/$pkgname"
-@@ -196,11 +226,19 @@
+@@ -142,11 +173,19 @@
rm "$copydir/$pkgname"
done
@@ -167,7 +140,7 @@
$repack || rm -rf "$copydir/build"
mkdir -p "$copydir/build"
-@@ -245,12 +283,12 @@
+@@ -192,12 +231,12 @@
printf 'builduser:x:%d:100:builduser:/:/usr/bin/nologin\n' "$builduser_uid" >>"$copydir/etc/passwd"
chown -R "$builduser_uid" "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir}
@@ -182,7 +155,7 @@
sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf"
echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf"
fi
-@@ -263,8 +301,20 @@
+@@ -210,8 +249,20 @@
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
fi
@@ -203,7 +176,7 @@
{
printf '#!/bin/bash\n'
declare -f _chrootbuild
-@@ -285,13 +335,19 @@
+@@ -232,13 +283,19 @@
chmod +x "$copydir/chrootbuild"
}
@@ -225,7 +198,7 @@
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o
else
( export SRCDEST BUILDDIR="$builddir"
-@@ -301,10 +357,10 @@
+@@ -248,10 +305,10 @@
(( $? != 0 )) && die "Could not download sources."
# Clean up garbage from verifysource
@@ -238,7 +211,7 @@
# This function isn't run in makechrootpkg,
# so no global variables
-@@ -313,6 +369,7 @@
+@@ -260,6 +317,7 @@
shopt -s nullglob
# XXX: Workaround makepkg disliking read-only dirs
@@ -246,7 +219,7 @@
ln -sft /srcdest /srcdest_host/*
ln -sft /startdir /startdir_host/*
-@@ -342,15 +399,42 @@
+@@ -289,15 +347,42 @@
exit 1
fi
@@ -290,18 +263,17 @@
for l in "$copydir"/logdest/*; do
[[ $l == */logpipe.* ]] && continue
chown "$src_owner" "$l"
-@@ -364,6 +448,10 @@
+@@ -311,6 +396,9 @@
}
# }}}
+main() {
+init_variables
-+parse_options_init
+
- umask 0022
+ orig_argv=("$@")
- load_vars "$USER_HOME/.makepkg.conf"
-@@ -375,30 +463,45 @@
+ while getopts 'hcur:I:l:nTD:d:' arg; do
+@@ -376,30 +464,45 @@
[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD
[[ -d $LOGDEST ]] || LOGDEST=$PWD
@@ -353,7 +325,7 @@
if (( ret != 0 )); then
if $temp_chroot; then
-@@ -409,3 +512,4 @@
+@@ -410,3 +513,4 @@
else
true
fi