SHA256
3
0
forked from pool/rpm

Accepting request 393284 from Base:System

- work around bug in rpm's macro expandsion

OBS-URL: https://build.opensuse.org/request/show/393284
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=239
This commit is contained in:
Dominique Leuenberger 2016-05-05 10:09:16 +00:00 committed by Git OBS Bridge
commit aa87bb3f14
8 changed files with 75 additions and 94 deletions

View File

@ -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
#*/

View File

@ -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 || :\

View File

@ -1,54 +0,0 @@
From 07f6674286467f82adf0d370b8d12d72aee6817c Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.com>
Date: Mon, 28 Sep 2015 18:21:19 +0200
Subject: [PATCH] Blocksize of NFS shouldn't be used directly
RPM uses the blocksize to calculate whether an RPM
can be installed on the system. For NFS this fails
for e.g. glibc-locale as it has many small files,
which rpm counts as one block. As huge NFS block
sizes (>= 1MiB) are common, this makes glibc-locale
roughly 7 GiB in installed size.
As a workaround, if the NFS block size is > 4096,
assume 4096 and scale the count of free blocks
accordingly.
See also RH bug 847960
Signed-off-by: Fabian Vogt <fvogt@suse.com>
---
lib/transaction.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/transaction.c b/lib/transaction.c
index 8167640..d8d8820 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -6,6 +6,8 @@
#include <inttypes.h>
+#include <linux/magic.h> /* NFS_SUPER_MAGIC */
+
#include <rpm/rpmlib.h> /* rpmMachineScore, rpmReadPackageFile */
#include <rpm/rpmmacro.h> /* XXX for rpmExpand */
#include <rpm/rpmlog.h>
@@ -137,6 +139,14 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(const rpmts ts, dev_t dev,
/* XXX assigning negative value to unsigned type */
dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
? sfb.f_ffree : -1;
+
+ /* We can't tell the block size of a network file system.
+ * sfb.f_bsize would be the network layer's block size. */
+ if(sfb.f_type == NFS_SUPER_MAGIC && dsi->bsize > 4096) {
+ int64_t old_bsize = dsi->bsize;
+ dsi->bsize = 4096; /* Assume 4k block size */
+ dsi->bavail *= old_bsize / dsi->bsize;
+ }
/* Find mount point belonging to this device number */
resolved_path = realpath(dirName, mntPoint);
--
2.5.2

16
normalize_blocksize.diff Normal file
View File

@ -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) {

View File

@ -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]) */

View File

@ -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() %{expand::%%service_del_postun %{?**}}
%stop_on_removal() %{expand:%%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
#
#

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Mon May 2 13:50:24 CEST 2016 - mls@suse.de
- work around bug in rpm's macro expandsion [bnc#969381]
-------------------------------------------------------------------
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
[bnc#968405] [bnc#969381]
-------------------------------------------------------------------
Fri Jan 15 19:20:15 UTC 2016 - stefan.bruens@rwth-aachen.de

View File

@ -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