From 2c06da35d658ce553807f68d6558071a57a32c99 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 16 Jan 2008 07:12:38 -0600 Subject: Don't clear build dir upon completion Clear when creating the dir, and additionally DO not clear it if the user is attempting to repack the package. Original-work-by: Jaroslaw Swierczynski Signed-off-by: Aaron Griffin --- makechrootpkg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'makechrootpkg') diff --git a/makechrootpkg b/makechrootpkg index 1e26042..5911b4e 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -11,6 +11,7 @@ FORCE="n" RUN="" MAKEPKG_ARGS="-Ss" +REPACK="" WORKDIR=$PWD clean_first="" @@ -59,6 +60,14 @@ done # Pass all arguments after -- right to makepkg MAKEPKG_ARGS="$MAKEPKG_ARGS ${*:$OPTIND}" +# See if -R was passed to makepkg +for arg in ${*:$OPTIND}; do + if [ "$arg" = "-R" ]; then + REPACK=1 + break; + fi +done + if [ "$EUID" != "0" ]; then echo "This script must be run as root." exit 1 @@ -102,6 +111,11 @@ trap 'cleanup' 0 1 2 15 echo "moving build files to chroot" [ -d "$uniondir/build" ] || mkdir "$uniondir/build" +if [ "$REPACK" != "1" ]; then + #Remove anything in there UNLESS -R (repack) was passed to makepkg + rm -rf "$uniondir/build/"* +fi + # Copy makepkg.conf and ~/.makepkg.conf into the chroot so packager has # all their custom variables set. if [ -r "/etc/makepkg.conf" ]; then -- cgit v1.2.3-70-g09d2