Add new option: --nocumulate, it can allow build without cumulative build 34/286734/1
authorbiao716.wang <biao716.wang@samsung.com>
Thu, 12 Jan 2023 07:44:29 +0000 (16:44 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Thu, 12 Jan 2023 07:45:16 +0000 (16:45 +0900)
Change-Id: I786df38e1ff07a29d301c73e38e58c1338816672
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
build
build-pkg-rpm
init_buildsystem

diff --git a/build b/build
index 374ebc98272139e071b98f45d8f6640a193391fa..13802657a98aa581d8f18dd420b88d4b4fc64055 100644 (file)
--- a/build
+++ b/build
@@ -102,6 +102,7 @@ CACHE_DIR=/var/cache/build
 USEHIGHERDEPS=
 PKG_CCACHE=
 CCACHE_SETUP_START_TIME=
+NOCUMULATE=
 
 # This is for insserv
 export YAST_IS_RUNNING=instsys
@@ -354,6 +355,8 @@ Known Parameters:
              (This options in kvm can not guarantee reproducible builds)
   --debug
               Enable creation of a debuginfo package
+  --nocumulate
+              Enable build without cumulative build.
 
 Remember to have fun!
 
@@ -918,6 +921,9 @@ while test -n "$1"; do
        test "$icecream" -gt 0 && BUILD_JOBS="$ARG"
        shift
       ;;
+      -nocumulate)
+       NOCUMULATE="--nocumulate"
+      ;;
       -ccache)
        CCACHE=true
       ;;
@@ -1069,7 +1075,7 @@ if test -n "$LIST_STATE" ; then
        recipe_unpack_srcrpm
        RECIPEFILE="$MYSRCDIR/$RECIPEFILE"
     fi
-    init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $KEEP_PACKS $USEHIGHERDEPS $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
+    init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $KEEP_PACKS $NOCUMULATE $USEHIGHERDEPS $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
     ERR=$?
     rm -rf "$BUILD_ROOT"
     cleanup_and_exit $ERR
@@ -1220,7 +1226,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
        test "$BUILDTYPE" = debootstrap && CREATE_BUILD_BINARIES=--create-build-binaries
        test "$BUILDTYPE" = livebuild && CREATE_BUILD_BINARIES=--create-build-binaries
        test "$BUILDTYPE" = snapcraft && CREATE_BUILD_BINARIES=--create-build-binaries
-       set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $KEEP_PACKS $USEHIGHERDEPS $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
+       set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $KEEP_PACKS $NOCUMULATE $USEHIGHERDEPS $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
        echo "$* ..."
         start_time=`date +%s`
        "$@" || cleanup_and_exit 1
index f834c005deb5b0059c929295768cf7179c6b7450..0b31576cfc94d325795d6db3d5a5350a0f049af0 100644 (file)
@@ -89,17 +89,13 @@ rpm_init_cumulate() {
 #    ref: https://review.tizen.org/gerrit/#/c/platform/upstream/build/+/25635/
 
     DO_CUMULATE=true
+
     local nocumulaterpms=$(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags nocumulaterpms)
     if test -n "$nocumulaterpms" ; then
-       test "$nocumulaterpms" != 0 && DO_CUMULATE=false
-    #else
-    #  # compatibility: auto-set cumulate for newer suse distros
-    #  typeset -ri suse_version=$(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" eval '%{?suse_version}')
-    #  if ((suse_version > 1220)) ; then
-    #      DO_CUMULATE=true
-    #  fi
+        test "$nocumulaterpms" != 0 && DO_CUMULATE=false
+    else
+        test "$NOCUMULATE" = true && DO_CUMULATE=false
     fi
-
 }
 
 pkg_verify_installed_rpm() {
index dfab8e34f4ef83ed2733404b48af74bb9e943215..3e4a892341042f8005e758c2666c76806053252e 100755 (executable)
@@ -55,6 +55,7 @@ test -x /usr/bin/rpmquery && RPMCHECKOPTS_HOST="--nodigest --nosignature"
 # should RPMs be installed with --force ?
 USE_FORCE=false
 PREPARE_VM=
+NOCUMULATE=false
 KEEP_PACKS=
 USEUSEDFORBUILD=
 LIST_STATE=
@@ -76,6 +77,10 @@ while test -n "$1" ; do
         shift
         KEEP_PACKS=true
         ;;
+        --nocumulate)
+        shift
+        NOCUMULATE=true
+        ;;
        --create-build-binaries)
            shift
            CREATE_BUILD_BINARIES=true