RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/rpmdb/ hdrNVR.c rpmdb.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 13 Oct 2007 - 11:23:21 CEST
Message-Id: <20071013092321.2EB3634845A@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   13-Oct-2007 11:23:21
  Branch: HEAD                             Handle: 2007101310232000

  Modified files:
    rpm/rpmdb               hdrNVR.c rpmdb.c

  Log:
    - more hge conevrsion.

  Summary:
    Revision    Changes     Path
    1.13        +20 -16     rpm/rpmdb/hdrNVR.c
    1.180       +1  -1      rpm/rpmdb/rpmdb.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/hdrNVR.c
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 hdrNVR.c
  --- rpm/rpmdb/hdrNVR.c	13 Oct 2007 00:27:17 -0000	1.12
  +++ rpm/rpmdb/hdrNVR.c	13 Oct 2007 09:23:20 -0000	1.13
  @@ -145,21 +145,22 @@
   		/*@unused@*/ const char **ep, const char **vp, const char **rp,
   		const char **ap)
   {
  +    HGE_t hge = (HGE_t)headerGetEntry;
       int type;
       int count;
   
       if (np) {
  -	if (!(headerGetEntry(h, RPMTAG_NAME, &type, np, &count)
  +	if (!(hge(h, RPMTAG_NAME, &type, np, &count)
   	    && type == RPM_STRING_TYPE && count == 1))
   		*np = NULL;
       }
       if (vp) {
  -	if (!(headerGetEntry(h, RPMTAG_VERSION, &type, vp, &count)
  +	if (!(hge(h, RPMTAG_VERSION, &type, vp, &count)
   	    && type == RPM_STRING_TYPE && count == 1))
   		*vp = NULL;
       }
       if (rp) {
  -	if (!(headerGetEntry(h, RPMTAG_RELEASE, &type, rp, &count)
  +	if (!(hge(h, RPMTAG_RELEASE, &type, rp, &count)
   	    && type == RPM_STRING_TYPE && count == 1))
   		*rp = NULL;
       }
  @@ -172,7 +173,7 @@
   	    *ap = "src";
   /*@=observertrans =readonlytrans@*/
   	else
  -	if (!(headerGetEntry(h, RPMTAG_ARCH, &type, ap, &count)
  +	if (!(hge(h, RPMTAG_ARCH, &type, ap, &count)
   	    && type == RPM_STRING_TYPE && count == 1))
   		*ap = NULL;
       }
  @@ -181,20 +182,23 @@
   
   uint_32 hGetColor(Header h)
   {
  -    HGE_t hge = (HGE_t)headerGetEntryMinMemory;
  +    HGE_t hge = (HGE_t)headerGetExtension;
  +    int_32 he_t = 0;
  +    hRET_t he_p = { .ptr = NULL };
  +    int_32 he_c = 0;
  +    HE_s he_s = { .tag = 0, .t = &he_t, .p = &he_p, .c = &he_c, .freeData = 0 };
  +    HE_t he = &he_s;
       uint_32 hcolor = 0;
  -    uint_32 * fcolors;
  -    int_32 ncolors;
  -    int i;
  -
  -    fcolors = NULL;
  -    ncolors = 0;
  -    if (hge(h, RPMTAG_FILECOLORS, NULL, &fcolors, &ncolors)
  -     && fcolors != NULL && ncolors > 0)
  -    {
  -	for (i = 0; i < ncolors; i++)
  -	    hcolor |= fcolors[i];
  +    int xx;
  +
  +    he->tag = RPMTAG_FILECOLORS;
  +    xx = hge(h, he->tag, he->t, he->p, he->c);
  +    if (xx && he_p.ptr != NULL && he_c > 0) {
  +	int i;
  +	for (i = 0; i < he_c; i++)
  +	    hcolor |= he_p.ui32p[i];
       }
  +    he_p.ptr = _free(he_p.ptr);
       hcolor &= 0x0f;
   
       return hcolor;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmdb.c
  ============================================================================
  $ cvs diff -u -r1.179 -r1.180 rpmdb.c
  --- rpm/rpmdb/rpmdb.c	13 Oct 2007 08:57:06 -0000	1.179
  +++ rpm/rpmdb/rpmdb.c	13 Oct 2007 09:23:20 -0000	1.180
  @@ -3540,7 +3540,7 @@
   {
   DBT * key;
   DBT * data;
  -    HGE_t hge = (HGE_t)headerGetEntryMinMemory;
  +    HGE_t hge = (HGE_t)headerGetExtension;
       int_32 he_t = 0;
       hRET_t he_p = { .ptr = NULL };
       int_32 he_c = 0;
  @@ .
Received on Sat Oct 13 11:23:21 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.