RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/build/ reqprov.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Sun 14 Oct 2007 - 20:29:10 CEST
Message-Id: <20071014182910.4A099348466@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:   14-Oct-2007 20:29:10
  Branch: HEAD                             Handle: 2007101419290802

  Modified files:
    rpm                     CHANGES
    rpm/build               reqprov.c

  Log:
    - reqprov.c: use headerGetExtension everywhere.

  Summary:
    Revision    Changes     Path
    1.1703      +1  -0      rpm/CHANGES
    1.70        +28 -13     rpm/build/reqprov.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1702 -r1.1703 CHANGES
  --- rpm/CHANGES	14 Oct 2007 18:21:56 -0000	1.1702
  +++ rpm/CHANGES	14 Oct 2007 18:29:08 -0000	1.1703
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: reqprov.c: use headerGetExtension everywhere.
       - jbj: parsePreamble.c: use headerGetExtension everywhere.
       - jbj: pack.c: use headerGetExtension everywhere.
       - jbj: files.c: fix: append to pkg->fileList.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/reqprov.c
  ============================================================================
  $ cvs diff -u -r1.69 -r1.70 reqprov.c
  --- rpm/build/reqprov.c	16 Jul 2007 01:32:26 -0000	1.69
  +++ rpm/build/reqprov.c	14 Oct 2007 18:29:10 -0000	1.70
  @@ -14,10 +14,13 @@
   		const char * N, const char * EVR, rpmsenseFlags Flags,
   		int index)
   {
  -    HGE_t hge = (HGE_t)headerGetEntryMinMemory;
  -    HFD_t hfd = headerFreeData;
  +    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;
       const char ** names;
  -    rpmTagType dnt;
       rpmTag nametag = 0;
       rpmTag versiontag = 0;
       rpmTag flagtag = 0;
  @@ -60,19 +63,29 @@
       /*@=branchstate@*/
       
       /* Check for duplicate dependencies. */
  -    if (hge(h, nametag, &dnt, &names, &len)) {
  +    he->tag = nametag;
  +    xx = hge(h, he->tag, he->t, he->p, he->c);
  +    names = he_p.argv;
  +    len = he_c;
  +    if (xx) {
   	const char ** versions = NULL;
  -	rpmTagType dvt = RPM_STRING_ARRAY_TYPE;
  -	int *flags = NULL;
  -	int *indexes = NULL;
  +	int_32 *flags = NULL;
  +	int_32 *indexes = NULL;
   	int duplicate = 0;
   
   	if (flagtag) {
  -	    xx = hge(h, versiontag, &dvt, &versions, NULL);
  -	    xx = hge(h, flagtag, NULL, &flags, NULL);
  +	    he->tag = versiontag;
  +	    xx = hge(h, he->tag, he->t, he->p, he->c);
  +	    versions = he_p.argv;
  +	    he->tag = flagtag;
  +	    xx = hge(h, he->tag, he->t, he->p, he->c);
  +	    flags = he_p.i32p;
  +	}
  +	if (indextag) {
  +	    he->tag = indextag;
  +	    xx = hge(h, he->tag, he->t, he->p, he->c);
  +	    indexes = he_p.i32p;
   	}
  -	if (indextag)
  -	    xx = hge(h, indextag, NULL, &indexes, NULL);
   
   /*@-boundsread@*/
   	while (len > 0) {
  @@ -91,8 +104,10 @@
   	    break;
   	}
   /*@=boundsread@*/
  -	names = hfd(names, dnt);
  -	versions = hfd(versions, dvt);
  +	names = _free(names);
  +	versions = _free(versions);
  +	flags = _free(flags);
  +	indexes = _free(indexes);
   	if (duplicate)
   	    return 0;
       }
  @@ .
Received on Sun Oct 14 20:29:10 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.