RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ query.c rpmlib.h

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 28 Aug 2007 - 02:12:38 CEST
Message-Id: <20070828001238.5DD9E34845B@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:   28-Aug-2007 02:12:38
  Branch: HEAD                             Handle: 2007082801123701

  Modified files:
    rpm                     CHANGES
    rpm/lib                 query.c rpmlib.h

  Log:
    - teach --querytags to chain through headerCompoundFormats.

  Summary:
    Revision    Changes     Path
    1.1603      +1  -0      rpm/CHANGES
    2.179       +16 -18     rpm/lib/query.c
    2.431       +5  -5      rpm/lib/rpmlib.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1602 -r1.1603 CHANGES
  --- rpm/CHANGES	25 Aug 2007 08:15:10 -0000	1.1602
  +++ rpm/CHANGES	28 Aug 2007 00:12:37 -0000	1.1603
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: teach --querytags to chain through headerCompoundFormats.
       - rse: apply upstream vendor Lua 5.1.2 patches 1-7
       - rse: add support for building against NEON >= 0.27.0
       - jbj: use keyutils to get password out of rpm's address space.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/query.c
  ============================================================================
  $ cvs diff -u -r2.178 -r2.179 query.c
  --- rpm/lib/query.c	21 Aug 2007 03:08:36 -0000	2.178
  +++ rpm/lib/query.c	28 Aug 2007 00:12:38 -0000	2.179
  @@ -373,8 +373,10 @@
   void rpmDisplayQueryTags(FILE * fp)
   {
       const struct headerTagTableEntry_s * t;
  -    int i;
  -    const struct headerSprintfExtension_s * ext = rpmHeaderFormats;
  +    int i, ttype;
  +    headerSprintfExtension exts = rpmHeaderFormats;
  +    headerSprintfExtension ext;
  +    int extNum;
   
       for (i = 0, t = rpmTagTable; i < rpmTagTableSize; i++, t++) {
   	if (t->name == NULL)
  @@ -387,27 +389,23 @@
   		"string", "blob", "argv", "i18nstring", "asn1", "openpgp"
   	    };
   	    fprintf(fp, " %6d", t->val);
  -	    if (t->type > RPM_NULL_TYPE && t->type <= RPM_MAX_TYPE)
  -		fprintf(fp, " %s", tagtypes[t->type]);
  +	    ttype = t->type & RPM_MASK_TYPE;
  +	    if (ttype > RPM_NULL_TYPE && ttype <= RPM_MAX_TYPE)
  +		fprintf(fp, " %s", tagtypes[ttype]);
   	}
   	fprintf(fp, "\n");
       }
   
  -    while (ext->name != NULL) {
  -	if (ext->type == HEADER_EXT_MORE) {
  -	    ext = ext->u.more;
  +    for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
  +	ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1), extNum++)
  +    {
  +	if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
   	    continue;
  -	}
  -	/* XXX don't print query tags twice. */
  -	for (i = 0, t = rpmTagTable; i < rpmTagTableSize; i++, t++) {
  -	    if (t->name == NULL)	/* XXX programmer error. */
  -		/*@innercontinue@*/ continue;
  -	    if (!strcmp(t->name, ext->name))
  -	    	/*@innerbreak@*/ break;
  -	}
  -	if (i >= rpmTagTableSize && ext->type == HEADER_EXT_TAG)
  -	    fprintf(fp, "%s\n", ext->name + 7);
  -	ext++;
  +
  +	/* XXX don't print header tags twice. */
  +	if (tagValue(ext->name) >= 0)
  +	    continue;
  +	fprintf(fp, "%s\n", ext->name + 7);
       }
   }
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmlib.h
  ============================================================================
  $ cvs diff -u -r2.430 -r2.431 rpmlib.h
  --- rpm/lib/rpmlib.h	17 Aug 2007 16:04:51 -0000	2.430
  +++ rpm/lib/rpmlib.h	28 Aug 2007 00:12:38 -0000	2.431
  @@ -179,13 +179,13 @@
   /** @todo: Somehow supply type **/
   typedef enum rpmTag_e {
   
  -    RPMTAG_HEADERIMAGE		= HEADER_IMAGE,		/*!< Current image. */
  -    RPMTAG_HEADERSIGNATURES	= HEADER_SIGNATURES,	/*!< Signatures. */
  -    RPMTAG_HEADERIMMUTABLE	= HEADER_IMMUTABLE,	/*!< Original image. */
  +    RPMTAG_HEADERIMAGE		= HEADER_IMAGE,		/*!< internal Current image. */
  +    RPMTAG_HEADERSIGNATURES	= HEADER_SIGNATURES,	/*!< internal Signatures. */
  +    RPMTAG_HEADERIMMUTABLE	= HEADER_IMMUTABLE,	/*!< x Original image. */
   /*@-enummemuse@*/
  -    RPMTAG_HEADERREGIONS	= HEADER_REGIONS,	/*!< Regions. */
  +    RPMTAG_HEADERREGIONS	= HEADER_REGIONS,	/*!< internal Regions. */
   
  -    RPMTAG_HEADERI18NTABLE	= HEADER_I18NTABLE, /*!< I18N string locales. */
  +    RPMTAG_HEADERI18NTABLE	= HEADER_I18NTABLE, /*!< s[] I18N string locales. */
   /*@=enummemuse@*/
   
   /* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
  @@ .
Received on Tue Aug 28 02:12:38 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.