RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-5_1: rpm/ CHANGES rpm/lib/ rpmts.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Fri 13 Aug 2010 - 18:04:27 CEST
Message-Id: <20100813160427.23E9ED1F97@rpm5.org>
  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 18:04:27
  Branch: rpm-5_1                          Handle: 2010081316042501

  Modified files:           (Branch: rpm-5_1)
    rpm                     CHANGES
    rpm/lib                 rpmts.c

  Log:
    - solve: fix: don't free the package file name when depsolving.

  Summary:
    Revision    Changes     Path
    1.2288.2.312+1  -0      rpm/CHANGES
    2.145.2.15  +25 -14     rpm/lib/rpmts.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2288.2.311 -r1.2288.2.312 CHANGES
  --- rpm/CHANGES	13 Aug 2010 15:52:22 -0000	1.2288.2.311
  +++ rpm/CHANGES	13 Aug 2010 16:04:25 -0000	1.2288.2.312
  @@ -1,5 +1,6 @@
   5.1.9 -> 5.1.10:
       - jbj: solve: flip --aid "opt-in" behavior to --noaid "opt-out".
  +    - jbj: solve: fix: don't free the package file name when depsolving.
       - jbj: tests: backport the IDMS install for coverage testing w sqlite3.
       - jbj: sqlite: fix: avoid assert failure w %trigger* SECONDARY-SEQENTIAL
   	retrieval using ony secondary keys for performance.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  ============================================================================
  $ cvs diff -u -r2.145.2.14 -r2.145.2.15 rpmts.c
  --- rpm/lib/rpmts.c	25 Jun 2009 12:41:17 -0000	2.145.2.14
  +++ rpm/lib/rpmts.c	13 Aug 2010 16:04:26 -0000	2.145.2.15
  @@ -250,19 +250,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);
  @@ -274,6 +278,9 @@
       }
       delMacro(NULL, "_dbpath");
   
  +exit:
  +if (_rpmts_debug)
  +fprintf(stderr, "<-- %s(%p, 0%o) rc %d\n", __FUNCTION__, ts, dbmode, rc);
       return rc;
   }
   
  @@ -305,19 +312,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;
  @@ -325,11 +335,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. */
  @@ -405,6 +416,7 @@
   	xx = Fclose(fd);
   	switch (rpmrc) {
   	default:
  +	    str = _free(str);
   	    break;
   	case RPMRC_NOTTRUSTED:
   	case RPMRC_NOKEY:
  @@ -418,7 +430,6 @@
   	    }
   	    break;
   	}
  -	str = _free(str);
   	(void)headerFree(h);
   	h = NULL;
   	goto exit;
  @@ -446,9 +457,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 18:04:27 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.