From 3a3fbf43f63ecf2709841108f8be919dc77c8af31dba3f7c0d6afaa6b8f11bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Thu, 21 Apr 2016 13:24:43 +0000 Subject: [PATCH] change OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=367 --- enable-postin-scripts-error.diff | 27 +++++++++++++++++++++++++++ macrosin.diff | 4 +--- normalize_blocksize.diff | 16 ++++++++++++++++ rpm-4.12.0.1-lua-5.3.patch | 6 ++---- rpm-suse_macros | 31 ++----------------------------- rpm.changes | 18 ++++++++++++++++++ rpm.spec | 7 +++---- 7 files changed, 69 insertions(+), 40 deletions(-) create mode 100644 enable-postin-scripts-error.diff create mode 100644 normalize_blocksize.diff diff --git a/enable-postin-scripts-error.diff b/enable-postin-scripts-error.diff new file mode 100644 index 0000000..f4c4e7c --- /dev/null +++ b/enable-postin-scripts-error.diff @@ -0,0 +1,27 @@ +--- ./lib/psm.c.orig 2016-04-21 13:22:27.901033751 +0000 ++++ ./lib/psm.c 2016-04-21 13:23:45.324742853 +0000 +@@ -285,7 +285,9 @@ static rpmRC runScript(rpmts ts, rpmte t + int warn_only = (stag != RPMTAG_PREIN && + stag != RPMTAG_PREUN && + stag != RPMTAG_PRETRANS && +- stag != RPMTAG_VERIFYSCRIPT); ++ stag != RPMTAG_VERIFYSCRIPT && ++ !(stag == RPMTAG_POSTIN && ++ rpmExpandNumeric("%{_fail_on_postinstall_errors}"))); + + sfd = rpmtsNotify(ts, te, RPMCALLBACK_SCRIPT_START, stag, 0); + if (sfd == NULL) +--- ./macros.in.orig 2016-04-21 13:21:58.933142657 +0000 ++++ ./macros.in 2016-04-21 13:22:27.902033748 +0000 +@@ -1327,6 +1327,11 @@ end} + %{-S:%{expand:%__scm_setup_%{-S*} %{!-v:-q}}}\ + %{!-N:%autopatch %{-v} %{-p:-p%{-p*}}} + ++# Should errors in %post scriptlet be propagated as errors? ++# ++# Note: set to 1 for legacy compatibility. ++%_fail_on_postinstall_errors 0 ++ + # \endverbatim + #*/ + diff --git a/macrosin.diff b/macrosin.diff index 0539972..57edfab 100644 --- a/macrosin.diff +++ b/macrosin.diff @@ -287,7 +287,7 @@ #------------------------------------------------------------------------------ # arch macro for all supported Sparc processors -@@ -1127,3 +1313,26 @@ end} +@@ -1127,3 +1313,24 @@ end} # \endverbatim #*/ @@ -306,8 +306,6 @@ +%{nil} + +%service_add() %{fillup_and_insserv %{1}} -+%service_del_preun() %{stop_on_removal %{1}} -+%service_del_postun() %{restart_on_update %{1}} + +%user_group_add() \ +/usr/sbin/groupadd -r %{1} 2>/dev/null || :\ diff --git a/normalize_blocksize.diff b/normalize_blocksize.diff new file mode 100644 index 0000000..b46e131 --- /dev/null +++ b/normalize_blocksize.diff @@ -0,0 +1,16 @@ +--- ./lib/transaction.c.orig 2016-04-21 12:21:53.649740302 +0000 ++++ ./lib/transaction.c 2016-04-21 12:28:00.821356311 +0000 +@@ -134,6 +134,13 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(c + dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) + ? sfb.f_ffree : -1; + ++ /* normalize block size to 4096 bytes if it is too big. */ ++ if (dsi->bsize > 4096) { ++ uint64_t old_size = dsi->bavail * dsi->bsize; ++ dsi->bsize = 4096; /* Assume 4k block size */ ++ dsi->bavail = old_size / dsi->bsize; ++ } ++ + /* Find mount point belonging to this device number */ + resolved_path = realpath(dirName, mntPoint); + if (!resolved_path) { diff --git a/rpm-4.12.0.1-lua-5.3.patch b/rpm-4.12.0.1-lua-5.3.patch index 6992bbe..e7ee9a1 100644 --- a/rpm-4.12.0.1-lua-5.3.patch +++ b/rpm-4.12.0.1-lua-5.3.patch @@ -1,7 +1,5 @@ -Index: rpm-4.12.0.1/luaext/lposix.c -=================================================================== ---- rpm-4.12.0.1.orig/luaext/lposix.c -+++ rpm-4.12.0.1/luaext/lposix.c +--- luaext/lposix.c ++++ luaext/lposix.c @@ -361,22 +361,35 @@ static int Pfork(lua_State *L) /** for static int Pwait(lua_State *L) /** wait([pid]) */ diff --git a/rpm-suse_macros b/rpm-suse_macros index 3ef4c98..f7016c0 100644 --- a/rpm-suse_macros +++ b/rpm-suse_macros @@ -21,36 +21,9 @@ /usr/lib/rpm/brp-suse \ %{nil} -# macro: %restart_on_update() -# Used to restart a service in postun section, if we are -# not running from YaST2 in instsys on update. -%restart_on_update() \ - test -n "$FIRST_ARG" || FIRST_ARG=$1 \ - if test "$FIRST_ARG" -ge 1 ; then \ - test -f /etc/sysconfig/services && . /etc/sysconfig/services \ - if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \ - test -x /bin/systemctl && /bin/systemctl daemon-reload >/dev/null 2>&1 || : \ - for service in %{?*} ; do \ - test -x /bin/systemctl && /bin/systemctl try-restart $service >/dev/null 2>&1 || : \ - done \ - fi \ - fi \ - %nil +%restart_on_update() %{service_del_postun %{?*}} +%stop_on_removal() %{service_del_preun %{?*}} -# macro: %stop_on_removal() -# Used to stop a service in preun section, if we are -# not running from YaST2 in instsys on removal of this package. -%stop_on_removal() \ - test -n "$FIRST_ARG" || FIRST_ARG=$1 \ - if test "$FIRST_ARG" = "0" ; then \ - test -f /etc/sysconfig/services && . /etc/sysconfig/services \ - if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \ - for service in %{?*} ; do \ - test -x /bin/systemctl && /bin/systemctl stop $service >/dev/null 2>&1 || : \ - done \ - fi \ - fi \ - %nil # macro: %configure_kernel_source # # diff --git a/rpm.changes b/rpm.changes index d345406..bce3917 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Thu Apr 21 15:08:22 CEST 2016 - mls@suse.de + +- tweak rpm-4.12.0.1-lua-5.3.patch so that it does not need + the -p1 option +- add option to make postinstall scriptlet errors fatal + [bnc#967728] + new patch: enable-postin-scripts-error.diff +- rework nfs-blocksize-free.patch to always normalize big + blocksizes to 4096 bytes + [bnc#894610] [bnc#829717] [bnc#965322] + removed patch: nfs-blocksize-free.patch + new patch: normalize_blocksize.diff +- drop service_del_preun, service_del_postun macros, they are + provided by the systemd package +- change restart_on_update and stop_on_removal macros to use + service_del_preun and service_del_postun + ------------------------------------------------------------------- Fri Jan 15 19:20:15 UTC 2016 - stefan.bruens@rwth-aachen.de diff --git a/rpm.spec b/rpm.spec index 506031f..71f6c55 100644 --- a/rpm.spec +++ b/rpm.spec @@ -133,7 +133,8 @@ Patch94: checksepwarn.diff Patch95: fixsizeforbigendian.diff Patch96: modalias-no-kgraft.diff Patch97: rpm-4.12.0.1-lua-5.3.patch -Patch98: nfs-blocksize-free.patch +Patch98: normalize_blocksize.diff +Patch99: enable-postin-scripts-error.diff Patch6464: auto-config-update-aarch64-ppc64le.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -227,9 +228,7 @@ rm -f rpmdb/db.h %patch -P 60 -P 61 -P 65 -P 66 -P 67 -P 68 -P 69 %patch -P 70 -P 71 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 %patch -P 85 -%patch -P 92 -P 93 -P 94 -P 95 -P 96 -%patch97 -p1 -%patch98 -p1 +%patch -P 92 -P 93 -P 94 -P 95 -P 96 -P 97 -P 98 -P 99 %ifarch aarch64 ppc64le %patch6464