Skip to content

Commit

Permalink
Do not erase $TOPDIR if --no-init is given twice
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Apr 9, 2015
1 parent a5c965f commit a2cc7c0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ABUILD_UID=399
ABUILD_GID=399

DO_INIT=true
DO_INIT_TOPDIR=true
DO_LINT=
DO_CHECKS=true
CLEAN_BUILD=
Expand Down Expand Up @@ -695,6 +696,7 @@ while test -n "$1"; do
cleanup_and_exit
;;
-noinit|-no-init)
test "$DO_INIT" = false && DO_INIT_TOPDIR=false
DO_INIT=false
;;
-nochecks|-no-checks)
Expand Down Expand Up @@ -925,6 +927,7 @@ fi

if test -n "$CLEAN_BUILD" ; then
DO_INIT=true
DO_INIT_TOPDIR=true
fi

if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
Expand Down
2 changes: 1 addition & 1 deletion build-recipe-arch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

recipe_setup_arch() {
TOPDIR=/usr/src/packages
rm -rf "$BUILD_ROOT$TOPDIR"
test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
Expand Down
2 changes: 1 addition & 1 deletion build-recipe-dsc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

recipe_setup_dsc() {
TOPDIR=/usr/src/packages
rm -rf "$BUILD_ROOT$TOPDIR"
test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
Expand Down
3 changes: 1 addition & 2 deletions build-recipe-livebuild
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
#################################################################

recipe_setup_livebuild() {

TOPDIR=/usr/src/packages
rm -rf "$BUILD_ROOT$TOPDIR"
test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
for i in OTHER SOURCES LIVEBUILD_ROOT ; do
mkdir -p "$BUILD_ROOT$TOPDIR/$i"
done
Expand Down
2 changes: 1 addition & 1 deletion build-recipe-spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ recipe_setup_spec() {
echo "Error: TOPDIR empty"
cleanup_and_exit 1
fi
rm -rf "$BUILD_ROOT$TOPDIR"
test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do
mkdir -p $BUILD_ROOT$TOPDIR/$i
done
Expand Down
1 change: 1 addition & 0 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ vm_first_stage() {
echo "INCARNATION='${INCARNATION//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "DO_INIT='${DO_INIT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "DO_INIT_TOPDIR='${DO_INIT_TOPDIR//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "KIWI_PARAMETERS='${KIWI_PARAMETERS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
test -n "$VM_SWAP" && echo "VM_SWAP='${VM_SWAPDEV//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
test -n "$VMDISK_MOUNT_OPTIONS" && echo "VMDISK_MOUNT_OPTIONS='${VMDISK_MOUNT_OPTIONS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
Expand Down

0 comments on commit a2cc7c0

Please sign in to comment.