From 3bfbb8352b1a2a5f899531831d7a60d46cc72ba6 Mon Sep 17 00:00:00 2001 From: "biao716.wang" Date: Wed, 14 Dec 2022 18:30:24 +0900 Subject: [PATCH] Support BuildFlags: nocumulaterpms - 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 --- build-pkg-rpm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/build-pkg-rpm b/build-pkg-rpm index 9f4b15d..f834c00 100644 --- a/build-pkg-rpm +++ b/build-pkg-rpm @@ -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]} -- 2.7.4