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 <swiergot@juvepoland.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
Aaron Griffin 2008-01-16 07:12:38 -06:00
parent eb7646ca18
commit 2c06da35d6
1 changed files with 14 additions and 0 deletions

View File

@ -11,6 +11,7 @@
FORCE="n" FORCE="n"
RUN="" RUN=""
MAKEPKG_ARGS="-Ss" MAKEPKG_ARGS="-Ss"
REPACK=""
WORKDIR=$PWD WORKDIR=$PWD
clean_first="" clean_first=""
@ -59,6 +60,14 @@ done
# Pass all arguments after -- right to makepkg # Pass all arguments after -- right to makepkg
MAKEPKG_ARGS="$MAKEPKG_ARGS ${*:$OPTIND}" 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 if [ "$EUID" != "0" ]; then
echo "This script must be run as root." echo "This script must be run as root."
exit 1 exit 1
@ -102,6 +111,11 @@ trap 'cleanup' 0 1 2 15
echo "moving build files to chroot" echo "moving build files to chroot"
[ -d "$uniondir/build" ] || mkdir "$uniondir/build" [ -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 # Copy makepkg.conf and ~/.makepkg.conf into the chroot so packager has
# all their custom variables set. # all their custom variables set.
if [ -r "/etc/makepkg.conf" ]; then if [ -r "/etc/makepkg.conf" ]; then