Support BuildFlags: nocumulaterpms 44/285544/2
authorbiao716.wang <biao716.wang@samsung.com>
Wed, 14 Dec 2022 09:30:24 +0000 (18:30 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Wed, 14 Dec 2022 12:38:59 +0000 (21:38 +0900)
- default condition : "DO_CUMULATE=true"
- If we specify "BuildFlags: nocumulaterpms" in project config --> set "DO_CUMULATE=false"

https://github.com/openSUSE/obs-build/commit/aee26521f91ee3d195d89f2c1f33072f5bf658b0

Change-Id: I360c8279797c43cb0adf1b9f0c6be2882fb47219
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
build-pkg-rpm

index 9f4b15d1b435a60fe7053bc5e6c7c56f06be8a80..f834c005deb5b0059c929295768cf7179c6b7450 100644 (file)
@@ -88,13 +88,18 @@ rpm_init_cumulate() {
 #
 #    ref: https://review.tizen.org/gerrit/#/c/platform/upstream/build/+/25635/
 
-
-#    DO_CUMULATE=
-#    typeset -ri suse_version=$(chroot "$BUILD_ROOT" rpm --eval '%{?suse_version}' 2>/dev/null)
-#    if ((suse_version > 1220)) ; then
-#      DO_CUMULATE=true
-#    fi
     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
+    fi
+
 }
 
 pkg_verify_installed_rpm() {
@@ -137,7 +142,7 @@ pkg_finalize_rpm() {
            rm -f "$BUILD_ROOT"/${CUMULATED_LIST[$num]}
            cp "$BUILD_ROOT"/.init_b_cache/rpms/$PKG "$BUILD_ROOT"/${CUMULATED_LIST[$num]} || cleanup_and_exit 1
        done > "$BUILD_ROOT"/.init_b_cache/manifest
-       ( cd "$BUILD_ROOT" && chroot "$BUILD_ROOT" rpm --ignorearch --noorder --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
+       ( cd "$BUILD_ROOT" && chroot "$BUILD_ROOT" rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
                $ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch "$BUILD_ROOT"/exit )
        for ((num=0; num<=cumulate; num++)) ; do
            rm -f "$BUILD_ROOT"/${CUMULATED_LIST[$num]}