RPM Package Manager, CVS Repository
/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 13-Aug-2010 17:49:41
Branch: rpm-5_2 Handle: 2010081315494001
Modified files: (Branch: rpm-5_2)
rpm CHANGES
rpm/lib rpmts.c
Log:
- solve: fix: don't free the package file name when depsolving.
Summary:
Revision Changes Path
1.2970.2.58 +1 -0 rpm/CHANGES
2.168.2.3 +25 -14 rpm/lib/rpmts.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2970.2.57 -r1.2970.2.58 CHANGES
--- rpm/CHANGES 13 Aug 2010 15:05:54 -0000 1.2970.2.57
+++ rpm/CHANGES 13 Aug 2010 15:49:40 -0000 1.2970.2.58
@@ -1,5 +1,6 @@
5.2.1 -> 5.2.2:
- jbj: solve: flip --aid "opt-in" behavior to --noaid "opt-out".
+ - jbj: solve: fix: don't free the package file name when depsolving.
- jbj: sqlite: fix: avoid assert failure w %trigger* SECONDARY-SEQUENTIAL
retrieval using only secondary keys for performance.
- jbj: fix: save chroot value across embedded scriptlet execution.
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmts.c
============================================================================
$ cvs diff -u -r2.168.2.2 -r2.168.2.3 rpmts.c
--- rpm/lib/rpmts.c 25 Jun 2009 12:39:57 -0000 2.168.2.2
+++ rpm/lib/rpmts.c 13 Aug 2010 15:49:41 -0000 2.168.2.3
@@ -258,19 +258,23 @@
static int has_sdbpath = -1;
int rc = 0;
- if (ts->sdb != NULL && ts->sdbmode == dbmode)
- return 0;
+ if (ts->sdb != NULL && ts->sdbmode == dbmode) {
+ rc = 0;
+ goto exit;
+ }
if (has_sdbpath < 0)
has_sdbpath = rpmExpandNumeric("%{?_solve_dbpath:1}");
/* If not configured, don't try to open. */
- if (has_sdbpath <= 0)
- return 1;
+ if (has_sdbpath <= 0) {
+ rc = 1;
+ goto exit;
+ }
addMacro(NULL, "_dbpath", NULL, "%{_solve_dbpath}", RMIL_DEFAULT);
- rc = rpmdbOpen(ts->rootDir, &ts->sdb, ts->sdbmode, 0644);
+ rc = rpmdbOpen(ts->rootDir, &ts->sdb, ts->sdbmode, (mode_t)0644);
if (rc) {
const char * dn;
dn = rpmGetPath(ts->rootDir, "%{_dbpath}", NULL);
@@ -282,6 +286,9 @@
}
delMacro(NULL, "_dbpath");
+exit:
+if (_rpmts_debug)
+fprintf(stderr, "<-- %s(%p, 0%o) rc %d\n", __FUNCTION__, ts, dbmode, rc);
return rc;
}
@@ -313,19 +320,22 @@
rpmTag rpmtag;
const char * keyp;
size_t keylen = 0;
- int rc = 1; /* assume not found */
+ int rc = 1; /* assume not found */
int xx;
+if (_rpmts_debug)
+fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
+
/* Make suggestions only for installing Requires: */
if (ts->goal != TSM_INSTALL)
- return rc;
+ goto exit;
switch (rpmdsTagN(ds)) {
case RPMTAG_CONFLICTNAME:
default:
- return rc;
+ goto exit;
/*@notreached@*/ break;
- case RPMTAG_DIRNAMES: /* XXX perhaps too many wrong answers */
+ case RPMTAG_DIRNAMES: /* XXX perhaps too many wrong answers? */
case RPMTAG_REQUIRENAME:
case RPMTAG_FILELINKTOS:
break;
@@ -333,11 +343,12 @@
keyp = rpmdsN(ds);
if (keyp == NULL)
- return rc;
+ goto exit;
if (ts->sdb == NULL) {
xx = rpmtsOpenSDB(ts, ts->sdbmode);
- if (xx) return rc;
+ if (xx)
+ goto exit;
}
/* Look for a matching Provides: in suggested universe. */
@@ -413,6 +424,7 @@
xx = Fclose(fd);
switch (rpmrc) {
default:
+ str = _free(str);
break;
case RPMRC_NOTTRUSTED:
case RPMRC_NOKEY:
@@ -426,7 +438,6 @@
}
break;
}
- str = _free(str);
(void)headerFree(h);
h = NULL;
goto exit;
@@ -454,9 +465,9 @@
qsort(ts->suggests, ts->nsuggests, sizeof(*ts->suggests), sugcmp);
exit:
-/*@-nullstate@*/ /* FIX: ts->suggests[] may be NULL */
+if (_rpmts_debug)
+fprintf(stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, ts, ds, data, rc);
return rc;
-/*@=nullstate@*/
}
int rpmtsAvailable(rpmts ts, const rpmds ds)
@@ .
Received on Fri Aug 13 17:49:41 2010