RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 19 Aug 2010 - 03:04:57 CEST
Message-Id: <20100819010458.7BDF9BA38D@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:   19-Aug-2010 03:04:57
  Branch: HEAD                             Handle: 2010081901045501

  Modified files:
    rpm                     CHANGES
    rpm/lib                 rpmts.c

  Log:
    - solve: use RPMTAG_PACKAGEORIGIN paths when available.

  Summary:
    Revision    Changes     Path
    1.3417      +1  -0      rpm/CHANGES
    2.187       +21 -12     rpm/lib/rpmts.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3416 -r1.3417 CHANGES
  --- rpm/CHANGES	16 Aug 2010 16:09:08 -0000	1.3416
  +++ rpm/CHANGES	19 Aug 2010 01:04:55 -0000	1.3417
  @@ -1,4 +1,5 @@
   5.3.2 -> 5.4a1:
  +    - jbj: solve: use RPMTAG_PACKAGEORIGIN paths when available.
       - jbj: neon: fix: permit building w neon-0.25.x.
       - jbj: ssl: fix: permit building w/o ECDSA.
       - jbj: ruby: fix: retrofit RSTRING_PTR/RSTRING_LEN into ruby-1.8.5.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  ============================================================================
  $ cvs diff -u -r2.186 -r2.187 rpmts.c
  --- rpm/lib/rpmts.c	13 Aug 2010 23:41:55 -0000	2.186
  +++ rpm/lib/rpmts.c	19 Aug 2010 01:04:56 -0000	2.187
  @@ -341,9 +341,8 @@
       HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
       rpmbag bag = ts->bag;
       rpmsdb * sdbp = NULL;
  -    const char * errstr;
  +    const char * errstr = NULL;
       const char * str = NULL;
  -    const char * qfmt;
       rpmmi mi;
       Header bh = NULL;
       Header h = NULL;
  @@ -400,7 +399,7 @@
   	    continue;
   
   	/* Look for a matching Provides: in suggested universe. */
  -	rpmtag = (*keyp == '/' ? RPMTAG_BASENAMES : RPMTAG_PROVIDENAME);
  +	rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
   	mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
   	while ((h = rpmmiNext(mi)) != NULL) {
   	    size_t hnamelen;
  @@ -441,15 +440,25 @@
       if (bh == NULL)
   	goto exit;
   
  -    /* Format the suggested resolution path. */
  -    qfmt = rpmExpand("%{?_solve_name_fmt}", NULL);
  -    if (qfmt == NULL || *qfmt == '\0')
  -	goto exit;
  -    str = headerSprintf(bh, qfmt, NULL, rpmHeaderFormats, &errstr);
  -    (void)headerFree(bh);
  +    /* Get the path to the package file. */
  +    he->tag = RPMTAG_PACKAGEORIGIN;
  +    he->p.ptr = NULL;
  +    xx = headerGet(bh, he, 0);
  +    if (he->p.str) {
  +	str = he->p.str;
  +	he->p.str = NULL;
  +    } else {
  +	/* Format the suggested resolution path. */
  +	const char * qfmt = rpmExpand("%{?_solve_name_fmt}", NULL);
  +	if (qfmt == NULL || *qfmt == '\0')
  +	    goto exit;
  +	str = headerSprintf(bh, qfmt, NULL, rpmHeaderFormats, &errstr);
  +	qfmt = _free(qfmt);
  +    }
  +
  +    (void) headerFree(bh);
       bh = NULL;
  -    qfmt = _free(qfmt);
  -    if (str == NULL) {
  +    if (errstr) {
   	rpmlog(RPMLOG_ERR, _("incorrect solve path format: %s\n"), errstr);
   	goto exit;
       }
  @@ -515,7 +524,7 @@
   
   exit:
   if (_rpmts_debug)
  -fprintf(stderr, "<-- %s(%p,%p,%p) rc %d\n", __FUNCTION__, ts, ds, data, rc);
  +fprintf(stderr, "<-- %s(%p,%p,%p) rc %d N %s EVR %s F 0x%x\n", __FUNCTION__, ts, ds, data, rc, rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds));
       return rc;
   }
   
  @@ .
Received on Thu Aug 19 03:05:01 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.