--- makechrootpkg.in 2015-02-28 18:53:37.000000000 +0300 +++ makechrootpkg.in 2015-04-02 15:59:34.631115027 +0300 @@ -8,17 +8,17 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. m4_include(lib/common.sh) shopt -s nullglob makepkg_args=(-s --noconfirm -L --holdver) -repack=false +keep_copydir=false update_first=false clean_first=false install_pkg= run_namcap=false temp_chroot=false chrootdir= passeddir= declare -a install_pkgs @@ -141,17 +141,17 @@ install_packages() { rm "$copydir/$pkgname" done # If there is no PKGBUILD we are done [[ -f PKGBUILD ]] || exit $ret } prepare_chroot() { - $repack || rm -rf "$copydir/build" + $keep_copydir || rm -rf "$copydir/build" mkdir -p "$copydir/build" if ! grep -q 'BUILDDIR="/build"' "$copydir/etc/makepkg.conf"; then echo 'BUILDDIR="/build"' >> "$copydir/etc/makepkg.conf" fi # Read .makepkg.conf and gnupg pubring if [[ -r $USER_HOME/.gnupg/pubring.kbx ]]; then @@ -343,26 +343,30 @@ if [[ ${copy:0:1} = / ]]; then copydir=$copy else copydir="$chrootdir/$copy" fi # Pass all arguments after -- right to makepkg makepkg_args+=("${@:$OPTIND}") -# See if -R was passed to makepkg +# See if -R or -e was passed to makepkg for arg in "${@:OPTIND}"; do case ${arg%%=*} in - -*R*|--repackage) - repack=true + -*R*|--repackage|-*e*|--noextract) + keep_copydir=true break 2 ;; esac done +if $keep_copydir && $clean_first; then + die "An incompatible command-line switches was specified: -c for ${0##*/} and -R or -e for makepkg" +fi + if [[ -n $SUDO_USER ]]; then eval "USER_HOME=~$SUDO_USER" else USER_HOME=$HOME fi umask 0022