diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-01-16 07:12:38 -0600 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-01-23 16:11:38 -0600 |
commit | 2c06da35d658ce553807f68d6558071a57a32c99 (patch) | |
tree | d32e6d372168a9e9f15c49dc0dfb38d85a71f710 | |
parent | eb7646ca18bf86036e6da576df8fae8bd78368f4 (diff) | |
download | devtools-2c06da35d658ce553807f68d6558071a57a32c99.tar.xz |
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>
-rwxr-xr-x | makechrootpkg | 14 |
1 files changed, 14 insertions, 0 deletions
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 |