summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild8
-rwxr-xr-xinit_buildsystem41
2 files changed, 30 insertions, 19 deletions
diff --git a/build b/build
index c3cb189..9cbd569 100755
--- a/build
+++ b/build
@@ -59,6 +59,7 @@ SHORT_CIRCUIT=false
NO_TOPDIR_CLEANUP=false
CLEAN_BUILD=
USE_SYSTEM_QEMU=
+KEEP_PACKS=
SPECFILES=()
SRCDIR=
BUILD_JOBS=
@@ -925,6 +926,9 @@ while test -n "$1"; do
*-use-system-qemu)
USE_SYSTEM_QEMU="--use-system-qemu"
;;
+ --keep-packs)
+ KEEP_PACKS="--keep-packs"
+ ;;
*-root)
needarg
BUILD_ROOT="$ARG"
@@ -1575,7 +1579,7 @@ for SPECFILE in "${SPECFILES[@]}" ; do
if test "$DO_INIT" = true ; then
# do fist stage of init_buildsystem
rm -f $BUILD_ROOT/.build.success
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --prepare "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --prepare "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $KEEP_PACKS $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
echo "$* ..."
"$@" || cleanup_and_exit 1
check_exit
@@ -1856,7 +1860,7 @@ for SPECFILE in "${SPECFILES[@]}" ; do
CREATE_BUILD_BINARIES=
test "$BUILDTYPE" = preinstallimage && mkdir -p $BUILD_ROOT/.preinstall_image
egrep '^#[ ]*needsbinariesforbuild[ ]*$' >/dev/null <$MYSRCDIR/$SPECFILE && CREATE_BUILD_BINARIES=--create-build-binaries
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $KEEP_PACKS $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
echo "$* ..."
"$@" || cleanup_and_exit 1
check_exit
diff --git a/init_buildsystem b/init_buildsystem
index 351671e..0d6f084 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -35,6 +35,7 @@ RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDTIME}\n"
PREPARE_VM=
USE_SYSTEM_QEMU=
+KEEP_PACKS=
USEUSEDFORBUILD=
LIST_STATE=
RPMLIST=
@@ -51,6 +52,10 @@ while test -n "$1" ; do
shift
USE_SYSTEM_QEMU=true
;;
+ --keep-packs)
+ shift
+ KEEP_PACKS=true
+ ;;
--create-build-binaries)
shift
CREATE_BUILD_BINARIES=true
@@ -1025,23 +1030,25 @@ rpm_e()
#
# delete all packages we don't want
#
-mkdir -p $BUILD_ROOT/.init_b_cache/todelete
-for PKG in $BUILD_ROOT/.init_b_cache/alreadyinstalled/* ; do
- PKG=${PKG##*/}
- test "$PKG" = "*" && continue
- ln $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG $BUILD_ROOT/.init_b_cache/todelete/$PKG
-done
-for PKG in $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL ; do
- rm -f $BUILD_ROOT/.init_b_cache/todelete/$PKG
-done
-for PKG in $BUILD_ROOT/.init_b_cache/todelete/* ; do
- PKG=${PKG##*/}
- test "$PKG" = "*" && continue
- echo "deleting $PKG"
- rpm_e "$PKG"
- check_exit
-done
-rm -rf "$BUILD_ROOT/.init_b_cache/todelete"
+if [ -z "$KEEP_PACKS" ]; then
+ mkdir -p $BUILD_ROOT/.init_b_cache/todelete
+ for PKG in $BUILD_ROOT/.init_b_cache/alreadyinstalled/* ; do
+ PKG=${PKG##*/}
+ test "$PKG" = "*" && continue
+ ln $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG $BUILD_ROOT/.init_b_cache/todelete/$PKG
+ done
+ for PKG in $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL ; do
+ rm -f $BUILD_ROOT/.init_b_cache/todelete/$PKG
+ done
+ for PKG in $BUILD_ROOT/.init_b_cache/todelete/* ; do
+ PKG=${PKG##*/}
+ test "$PKG" = "*" && continue
+ echo "deleting $PKG"
+ rpm_e "$PKG"
+ check_exit
+ done
+ rm -rf "$BUILD_ROOT/.init_b_cache/todelete"
+fi
rm -rf "$BUILD_ROOT/.init_b_cache/preinstalls"
mkdir -p "$BUILD_ROOT/.init_b_cache/preinstalls"