summaryrefslogtreecommitdiff
path: root/init_buildsystem
diff options
context:
space:
mode:
authorZhang Qiang <qiang.z.zhang@intel.com>2013-11-22 10:25:06 +0800
committerZhang Qiang <qiang.z.zhang@intel.com>2014-04-03 15:53:09 +0800
commite2c20c4b404291c8b79d1c142e8087c9f6ea322e (patch)
tree4ee2280f61c575640b65fbccca6ff5e4e2f99b06 /init_buildsystem
parentbdcae69d8d6fd3547921211d5b40ddc7a62522e7 (diff)
downloadbuild-e2c20c4b404291c8b79d1c142e8087c9f6ea322e.tar.gz
build-e2c20c4b404291c8b79d1c142e8087c9f6ea322e.tar.bz2
build-e2c20c4b404291c8b79d1c142e8087c9f6ea322e.zip
Add option --keep-packs to keep packages already in build root
with --keep-packs, unused packages will not be removed while resusing buildroot. This can speed up build hundred of packages significantly. This option also usefull to create a single buildroot to share with other developers to build all packages. Change-Id: Ibcb68e49b8eed0bdf695485c2ec79a8eb4efb824
Diffstat (limited to 'init_buildsystem')
-rwxr-xr-xinit_buildsystem41
1 files changed, 24 insertions, 17 deletions
diff --git a/init_buildsystem b/init_buildsystem
index ff0bddd..c7dc95a 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
@@ -906,23 +911,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; 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; 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"