Accepting request 18841 from Base:System
Copy from Base:System/rpm based on submit request 18841 from user mlschroe OBS-URL: https://build.opensuse.org/request/show/18841 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=84
This commit is contained in:
committed by
Git OBS Bridge
parent
bd5319d2fe
commit
25f00b6cb5
@@ -9,29 +9,29 @@ Index: lib/psm.c
|
||||
===================================================================
|
||||
--- lib/psm.c.orig
|
||||
+++ lib/psm.c
|
||||
@@ -813,6 +813,8 @@ static rpmRC runScript(rpmpsm psm, Heade
|
||||
@@ -756,6 +756,8 @@ static rpmRC runScript(rpmpsm psm, Heade
|
||||
goto exit;
|
||||
}
|
||||
if (out == NULL) return RPMRC_FAIL; /* XXX can't happen */
|
||||
|
||||
+ rpmtsSuspendResumeDBLock(psm->ts, 0);
|
||||
+
|
||||
/*@-branchstate@*/
|
||||
xx = rpmsqFork(&psm->sq);
|
||||
if (psm->sq.child == 0) {
|
||||
@@ -933,6 +935,8 @@ static rpmRC runScript(rpmpsm psm, Heade
|
||||
rpmlog(RPMLOG_DEBUG, "%s: %s\texecv(%s) pid %d\n",
|
||||
@@ -770,6 +772,8 @@ static rpmRC runScript(rpmpsm psm, Heade
|
||||
|
||||
(void) psmWait(psm);
|
||||
|
||||
+ rpmtsSuspendResumeDBLock(psm->ts, 1);
|
||||
+
|
||||
/* XXX filter order dependent multilib "other" arch helper error. */
|
||||
if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) {
|
||||
if (psm->sq.reaped < 0) {
|
||||
rpmlog(RPMLOG_ERR, _("%s scriptlet failed, waitpid(%d) rc %d: %s\n"),
|
||||
sname, psm->sq.child, psm->sq.reaped, strerror(errno));
|
||||
Index: lib/rpmts.c
|
||||
===================================================================
|
||||
--- lib/rpmts.c.orig
|
||||
+++ lib/rpmts.c
|
||||
@@ -190,6 +190,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
|
||||
@@ -108,6 +108,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -47,31 +47,30 @@ Index: lib/rpmts.h
|
||||
===================================================================
|
||||
--- lib/rpmts.h.orig
|
||||
+++ lib/rpmts.h
|
||||
@@ -476,6 +476,10 @@ int rpmtsRebuildDB(rpmts ts)
|
||||
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
||||
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
||||
@@ -472,6 +472,10 @@ rpmdb rpmtsGetRdb(rpmts ts);
|
||||
*/
|
||||
int rpmtsInitDSI(const rpmts ts);
|
||||
|
||||
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode)
|
||||
+ /*@globals fileSystem @*/
|
||||
+ /*@modifies fileSystem @*/;
|
||||
+
|
||||
/** \ingroup rpmts
|
||||
* Verify the database used by the transaction.
|
||||
* Update disk space info for a file.
|
||||
* @param ts transaction set
|
||||
Index: rpmdb/db3.c
|
||||
Index: lib/backend/db3.c
|
||||
===================================================================
|
||||
--- rpmdb/db3.c.orig
|
||||
+++ rpmdb/db3.c
|
||||
@@ -458,6 +458,8 @@ errxit:
|
||||
--- lib/backend/db3.c.orig
|
||||
+++ lib/backend/db3.c
|
||||
@@ -398,12 +398,18 @@ errxit:
|
||||
return rc;
|
||||
}
|
||||
/*@=moduncon@*/
|
||||
|
||||
+static int db3SuspendResumeLock(dbiIndex dbi, int mode);
|
||||
+
|
||||
static int db3sync(dbiIndex dbi, unsigned int flags)
|
||||
/*@globals fileSystem @*/
|
||||
/*@modifies fileSystem @*/
|
||||
@@ -466,6 +468,10 @@ static int db3sync(dbiIndex dbi, unsigne
|
||||
{
|
||||
DB * db = dbi->dbi_db;
|
||||
int rc = 0;
|
||||
int _printit;
|
||||
|
||||
@@ -82,8 +81,8 @@ Index: rpmdb/db3.c
|
||||
if (db != NULL)
|
||||
rc = db->sync(db, flags);
|
||||
/* XXX DB_INCOMPLETE is returned occaisionally with multiple access. */
|
||||
@@ -1412,6 +1418,50 @@ static int db3open(rpmdb rpmdb, rpmTag r
|
||||
/*@=nullstate =compmempass@*/
|
||||
@@ -1122,6 +1128,50 @@ static int db3open(rpmdb rpmdb, rpmTag r
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static int
|
||||
@@ -112,7 +111,7 @@ Index: rpmdb/db3.c
|
||||
+ l.l_type = F_RDLCK;
|
||||
+ rc = fcntl(fdno, F_SETLK, (void *) &l);
|
||||
+ if (rc)
|
||||
+ rpmMessage(RPMMESS_WARNING, _("could not suspend database lock\n"));
|
||||
+ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n"));
|
||||
+ } else {
|
||||
+ for (tries = 0; tries < 2; tries++) {
|
||||
+ memset(&l, 0, sizeof(l));
|
||||
@@ -124,7 +123,7 @@ Index: rpmdb/db3.c
|
||||
+ if (!rc)
|
||||
+ break;
|
||||
+ if (tries == 0)
|
||||
+ rpmMessage(RPMMESS_WARNING, _("waiting to reestablish exclusive database lock\n"));
|
||||
+ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n"));
|
||||
+ }
|
||||
+ }
|
||||
+ return rc;
|
||||
@@ -132,12 +131,12 @@ Index: rpmdb/db3.c
|
||||
+
|
||||
/** \ingroup db3
|
||||
*/
|
||||
/*@-exportheadervar@*/
|
||||
Index: rpmdb/rpmdb.c
|
||||
RPM_GNUC_INTERNAL
|
||||
Index: lib/rpmdb.c
|
||||
===================================================================
|
||||
--- rpmdb/rpmdb.c.orig
|
||||
+++ rpmdb/rpmdb.c
|
||||
@@ -945,6 +945,21 @@ int rpmdbSync(rpmdb db)
|
||||
--- lib/rpmdb.c.orig
|
||||
+++ lib/rpmdb.c
|
||||
@@ -886,6 +886,21 @@ int rpmdbSync(rpmdb db)
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -156,6 +155,6 @@ Index: rpmdb/rpmdb.c
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
/*@-mods@*/ /* FIX: dbTemplate structure assignment */
|
||||
static /*@only@*/ /*@null@*/
|
||||
rpmdb newRpmdb(/*@kept@*/ /*@null@*/ const char * root,
|
||||
/* FIX: dbTemplate structure assignment */
|
||||
static
|
||||
rpmdb newRpmdb(const char * root,
|
||||
|
Reference in New Issue
Block a user