- backport noposttrans.diff from rpm master [bnc#773575]

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=279
This commit is contained in:
Michael Schröder 2013-07-15 14:18:29 +00:00 committed by Git OBS Bridge
parent 654190f0f7
commit 455f774515
3 changed files with 122 additions and 1 deletions

115
noposttrans.diff Normal file
View File

@ -0,0 +1,115 @@
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Wed Apr 10 11:31:41 2013 +0300
Add scriptlet-specific disablers for %pretrans and %posttrans
- Previously %pretrans and %posttrans were tied to --nopre and --nopost
disablers (since commit 0b2d7775c5e828652e45829f551352b93890bbc8)
because back then, there was no room new disablers in rpmtransFlags
bitfield. This is no longer the case as of rpm >= 4.9.x where
a bunch of obsolete flags were axed, so we can now add specific
--nopretrans and --noposttrans switches + corresponding flags.
- This is obviously a behavior change as --nopre and --nopost no
longer affect %pretrans and %posttrans, but --noscripts behavior
remains the same.
--- doc/rpm.8
+++ doc/rpm.8
@@ -278,6 +278,10 @@ packages would normally be reordered to satisfy dependencies.
\fB--nopreun\fR
.TP
\fB--nopostun\fR
+.TP
+\fB--nopretrans\fR
+.TP
+\fB--noposttrans\fR
Don't execute the scriptlet of the same name.
The \fB--noscripts\fR option is equivalent to
@@ -285,12 +289,16 @@ The \fB--noscripts\fR option is equivalent to
\fB--nopost\fR
\fB--nopreun\fR
\fB--nopostun\fR
+\fB--nopretrans\fR
+\fB--noposttrans\fR
and turns off the execution of the corresponding
\fB%pre\fR,
\fB%post\fR,
-\fB%preun\fR, and
+\fB%preun\fR,
\fB%postun\fR
+\fB%pretrans\fR, and
+\fB%posttrans\fR
scriptlet(s).
.TP
\fB--notriggers\fR
--- lib/poptI.c
+++ lib/poptI.c
@@ -202,6 +202,12 @@ struct poptOption rpmInstallPoptTable[] = {
{ "nopostun", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
RPMTRANS_FLAG_NOPOSTUN,
N_("do not execute %%postun scriptlet (if any)"), NULL },
+ { "nopretrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
+ RPMTRANS_FLAG_NOPRETRANS,
+ N_("do not execute %%pretrans scriptlet (if any)"), NULL },
+ { "noposttrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
+ RPMTRANS_FLAG_NOPOSTTRANS,
+ N_("do not execute %%posttrans scriptlet (if any)"), NULL },
{ "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, _noTransTriggers,
N_("do not execute any scriptlet(s) triggered by this package"), NULL},
--- lib/rpmts.h
+++ lib/rpmts.h
@@ -45,7 +45,8 @@ enum rpmtransFlags_e {
RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */
RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */
RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */
- /* bits 24-25 unused */
+ RPMTRANS_FLAG_NOPRETRANS = (1 << 24), /*!< from --nopretrans */
+ RPMTRANS_FLAG_NOPOSTTRANS = (1 << 25), /*!< from --noposttrans */
RPMTRANS_FLAG_NOCOLLECTIONS = (1 << 26), /*!< from --nocollections */
RPMTRANS_FLAG_NOMD5 = (1 << 27), /*!< from --nomd5 */
RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27), /*!< from --nofiledigest (alias to --nomd5) */
@@ -60,7 +61,9 @@ typedef rpmFlags rpmtransFlags;
( RPMTRANS_FLAG_NOPRE | \
RPMTRANS_FLAG_NOPOST | \
RPMTRANS_FLAG_NOPREUN | \
- RPMTRANS_FLAG_NOPOSTUN \
+ RPMTRANS_FLAG_NOPOSTUN | \
+ RPMTRANS_FLAG_NOPRETRANS | \
+ RPMTRANS_FLAG_NOPOSTTRANS \
)
#define _noTransTriggers \
--- lib/transaction.c
+++ lib/transaction.c
@@ -1496,7 +1496,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
/* Run pre-transaction scripts, but only if there are no known
* problems up to this point and not disabled otherwise. */
- if (!((rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRE))
+ if (!((rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRETRANS))
|| (rpmpsNumProblems(tsprobs)))) {
rpmlog(RPMLOG_DEBUG, "running pre-transaction scripts\n");
runTransScripts(ts, PKG_PRETRANS);
@@ -1532,7 +1532,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rc = rpmtsProcess(ts) ? -1 : 0;
/* Run post-transaction scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOST))) {
+ if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) {
rpmlog(RPMLOG_DEBUG, "running post-transaction scripts\n");
runTransScripts(ts, PKG_POSTTRANS);
}
--- python/rpmmodule.c
+++ python/rpmmodule.c
@@ -414,6 +414,8 @@ static int initModule(PyObject *m)
REGISTER_ENUM(RPMTRANS_FLAG_NOPREUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
+ REGISTER_ENUM(RPMTRANS_FLAG_NOPRETRANS);
+ REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTTRANS);
REGISTER_ENUM(RPMTRANS_FLAG_NOMD5);
REGISTER_ENUM(RPMTRANS_FLAG_NOFILEDIGEST);
REGISTER_ENUM(RPMTRANS_FLAG_NOSUGGEST);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jul 15 16:17:45 CEST 2013 - mls@suse.de
- backport noposttrans.diff from rpm master [bnc#773575]
-------------------------------------------------------------------
Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de

View File

@ -133,6 +133,7 @@ Patch78: headerchk2.diff
Patch79: helperenv.diff
Patch80: psm-errno.diff
Patch81: getauxval.diff
Patch82: noposttrans.diff
Patch6464: auto-config-update-aarch64.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
@ -219,7 +220,7 @@ rm -f rpmdb/db.h
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59
%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79
%patch -P 80 -P 81
%patch -P 80 -P 81 -P 82
%ifarch aarch64
%patch6464
%endif