Commit 2c06da35 authored by Aaron Griffin's avatar Aaron Griffin
Browse files

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: default avatarJaroslaw Swierczynski <swiergot@juvepoland.com>
Signed-off-by: default avatarAaron Griffin <aaronmgriffin@gmail.com>
parent eb7646ca
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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