RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 19 Aug 2010 - 03:05:37 CEST
Message-Id: <20100819010537.1FFE4BA3E6@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:05:36
  Branch: rpm-5_3                          Handle: 2010081901053203

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

  Log:
    - solve: use RPMTAG_PACKAGEORIGIN paths when available.

  Summary:
    Revision    Changes     Path
    1.3296.2.59 +1  -0      rpm/CHANGES
    2.181.2.5   +20 -11     rpm/lib/rpmts.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3296.2.58 -r1.3296.2.59 CHANGES
  --- rpm/CHANGES	16 Aug 2010 15:07:14 -0000	1.3296.2.58
  +++ rpm/CHANGES	19 Aug 2010 01:05:32 -0000	1.3296.2.59
  @@ -1,4 +1,5 @@
   5.3.2 -> 5.3.3:
  +    - 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.181.2.4 -r2.181.2.5 rpmts.c
  --- rpm/lib/rpmts.c	13 Aug 2010 23:41:36 -0000	2.181.2.4
  +++ rpm/lib/rpmts.c	19 Aug 2010 01:05:35 -0000	2.181.2.5
  @@ -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;
  @@ -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:37 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.