diff options
-rwxr-xr-x | src/chroot-tools/libremakepkg | 11 | ||||
-rw-r--r-- | src/chroot-tools/makechrootpkg.sh.patch | 44 |
2 files changed, 31 insertions, 24 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 767dff8..a226e38 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -106,8 +106,9 @@ cleanup() { } build() ( - local copydir=$1; shift - local repack=$1; shift + local copydir=$1 + local repack=$2 + local makepkg_args=("${@:3}") local run_ynet=() local run_nnet=() @@ -121,10 +122,10 @@ build() ( $NONET || run_nnet=("${run_ynet[@]}") prepare_chroot "$copydir" "$LIBREHOME" "$repack" false - "${run_ynet[@]}" /chrootprepare false "$@" |& indent + "${run_ynet[@]}" /chrootprepare "${makepkg_args[@]}" |& indent run_hook pre_build "$copydir" - trap "run_hook post_build '$copydir'" EXIT - "${run_nnet[@]}" /chrootbuild false "$@" |& indent + trap "run_hook post_build $(printf '%q' "$copydir")" EXIT + "${run_nnet[@]}" /chrootbuild "${makepkg_args[@]}" |& indent ) # The main program ############################################################# diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index a17b2d3..6d5fc22 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2015-04-13 12:25:34.551599741 -0400 -+++ makechrootpkg.sh.ugly 2015-04-13 12:25:34.574932652 -0400 +--- makechrootpkg.sh.in 2015-06-06 14:36:36.135418975 -0600 ++++ makechrootpkg.sh.ugly 2015-06-06 14:36:12.398465200 -0600 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -140,7 +140,7 @@ $repack || rm -rf "$copydir/build" mkdir -p "$copydir/build" -@@ -192,12 +231,12 @@ +@@ -193,12 +232,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} @@ -155,7 +155,7 @@ sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" fi -@@ -210,8 +249,20 @@ +@@ -211,10 +250,25 @@ chmod 440 "$copydir/etc/sudoers.d/builduser-pacman" fi @@ -170,13 +170,18 @@ + # This is a little gross, but this way the script is recreated every time in the # working copy -+ printf $'#!/bin/bash\n%s\n_chrootprepare "$@"' "$(declare -f _chrootprepare)" \ -+ > "$copydir/chrootprepare" -+ chmod +x "$copydir/chrootprepare" { printf '#!/bin/bash\n' ++ declare -f _chrootprepare ++ printf '_chrootprepare "$@"\n' ++ } > "$copydir/chrootprepare" ++ chmod +x "$copydir/chrootprepare" ++ { ++ printf '#!/bin/bash\n' declare -f _chrootbuild -@@ -232,13 +283,19 @@ + printf '_chrootbuild "$@" || exit\n' + +@@ -231,13 +285,19 @@ chmod +x "$copydir/chrootbuild" } @@ -198,7 +203,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -248,10 +305,10 @@ +@@ -247,10 +307,10 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -211,7 +216,7 @@ # This function isn't run in makechrootpkg, # so no global variables -@@ -260,6 +317,7 @@ +@@ -259,6 +319,7 @@ shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs @@ -219,7 +224,7 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -289,15 +347,42 @@ +@@ -288,15 +349,42 @@ exit 1 fi @@ -263,7 +268,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -311,6 +396,9 @@ +@@ -310,6 +398,9 @@ } # }}} @@ -273,7 +278,7 @@ orig_argv=("$@") while getopts 'hcur:I:l:nTD:d:' arg; do -@@ -376,30 +464,45 @@ +@@ -375,30 +466,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -297,22 +302,23 @@ + [[ -f PKGBUILD ]] || exit $ret +fi --prepare_chroot -+prepare_chroot "$copydir" "$USER_HOME" "$repack" - -download_sources +download_sources "$copydir" "$src_owner" +-prepare_chroot ++prepare_chroot "$copydir" "$USER_HOME" "$repack" + if arch-nspawn "$copydir" \ --bind-ro="$PWD:/startdir_host" \ --bind-ro="$SRCDEST:/srcdest_host" \ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ +- /chrootbuild "${makepkg_args[@]}" + /chrootprepare && -+ arch-nspawn "$copydir" \ ++ arch-nspawn "$copydir" \ + --bind-ro="$PWD:/startdir_host" \ + --bind-ro="$SRCDEST:/srcdest_host" \ + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ - /chrootbuild "${makepkg_args[@]}" ++ /chrootbuild then - move_products + move_products "$copydir" "$src_owner" @@ -325,7 +331,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -410,3 +513,4 @@ +@@ -409,3 +515,4 @@ else true fi |