RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES TODO rpm/lib/ rpmchecksig.c rpm/rpmdb/ hdrinli...

From: Jeff Johnson <jbj@rpm5.org>
Date: Mon 12 Nov 2007 - 19:29:21 CET
Message-Id: <20071112182921.F1867348495@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:   12-Nov-2007 19:29:21
  Branch: HEAD                             Handle: 2007111218292001

  Modified files:
    rpm                     CHANGES TODO
    rpm/lib                 rpmchecksig.c
    rpm/rpmdb               hdrinline.h header.c header.h

  Log:
    - hmmm, markReplacedFiles() breaks here, todo++. noone will notice.
    - eliminate headerGetEntryMinMemory(), use headerGet{Entry,Extension}.
    - invent pubkey/pubkey arch/os convention to avoid missing value pain.
    - use RPM_I18NSTRING_TYPE where needed for pubkey imports.

  Summary:
    Revision    Changes     Path
    1.1814      +4  -0      rpm/CHANGES
    1.10        +8  -0      rpm/TODO
    1.172       +26 -3      rpm/lib/rpmchecksig.c
    1.30        +1  -26     rpm/rpmdb/hdrinline.h
    1.117       +2  -35     rpm/rpmdb/header.c
    1.62        +1  -23     rpm/rpmdb/header.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1813 -r1.1814 CHANGES
  --- rpm/CHANGES	12 Nov 2007 14:33:57 -0000	1.1813
  +++ rpm/CHANGES	12 Nov 2007 18:29:20 -0000	1.1814
  @@ -1,4 +1,8 @@
   5.0a1 -> 5.0a2:
  +    - jbj: hmmm, markReplacedFiles() breaks here, todo++. noone will notice.
  +    - jbj: eliminate headerGetEntryMinMemory(), use headerGet{Entry,Extension}.
  +    - jbj: invent pubkey/pubkey arch/os convention to avoid missing value pain.
  +    - jbj: use RPM_I18NSTRING_TYPE where needed for pubkey imports.
       - rse: relocate <stdint.h> usage to "system.h", too.
       - rse: relocate <inttypes.h> usage to "system.h" and add corresponding Autoconf check
       - rse: fix type mismatches between function prototype and function definitions related to uint64_t
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/TODO
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 TODO
  --- rpm/TODO	11 Nov 2007 23:59:19 -0000	1.9
  +++ rpm/TODO	12 Nov 2007 18:29:20 -0000	1.10
  @@ -60,6 +60,14 @@
       - jbj: C++ and C have different rules regarding typedef'd enums like rpmTag.
   	The definitions and usage are currently split awkwardly between
   	rpmtag.h and header.h.
  +    - jbj: Heh, --import has *always* used the wrong data type for
  +	Summary/Description/Group. The header that carries the pubkey
  +	lacks RPMTAG_ARCH/RPMTAG_OS as well. Re-importing all pubkeys is
  +	one solution, but perhaps a "just works" slam-dunk hack is needed
  +	during --rebuildb, or with header extensions.
  +    - jbj: markReplacedFiles() subtly rewrites header back into rpmdb
  +	with altered RPMTAG_FILESTATES data. get/del/add sequence
  +	is needed instead.
   
     o to be resolved before RPM 5.0.0:
       - rse: NEWS polishing
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmchecksig.c
  ============================================================================
  $ cvs diff -u -r1.171 -r1.172 rpmchecksig.c
  --- rpm/lib/rpmchecksig.c	11 Nov 2007 04:04:26 -0000	1.171
  +++ rpm/lib/rpmchecksig.c	12 Nov 2007 18:29:21 -0000	1.172
  @@ -566,17 +566,40 @@
       he->tag = RPMTAG_RELEASE;
       he->p.str = r;
       xx = hae(h, he, 0);
  +
  +    /* Add Summary/Description/Group. */
       he->tag = RPMTAG_DESCRIPTION;
       he->p.str = d;
  +#ifdef	BORKED	/* XXX RPM_I18NSTRING_TYPE fixing. */
       xx = hae(h, he, 0);
  +#else
  +    xx = headerAddI18NString(h, he->tag, he->p.ptr, "C");
  +#endif
       he->tag = RPMTAG_GROUP;
       he->p.str = group;
  +#ifdef	BORKED	/* XXX RPM_I18NSTRING_TYPE fixing. */
       xx = hae(h, he, 0);
  -    he->tag = RPMTAG_LICENSE;
  -    he->p.str = license;
  -    xx = hae(h, he, 0);
  +#else
  +    xx = headerAddI18NString(h, he->tag, he->p.ptr, "C");
  +#endif
       he->tag = RPMTAG_SUMMARY;
       he->p.str = u;
  +#ifdef	BORKED	/* XXX RPM_I18NSTRING_TYPE fixing. */
  +    xx = hae(h, he, 0);
  +#else
  +    xx = headerAddI18NString(h, he->tag, he->p.ptr, "C");
  +#endif
  +
  +    /* Add a "pubkey" arch/os to avoid missing value NULL ptrs. */
  +    he->tag = RPMTAG_ARCH;
  +    he->p.str = "pubkey";
  +    xx = hae(h, he, 0);
  +    he->tag = RPMTAG_OS;
  +    he->p.str = "pubkey";
  +    xx = hae(h, he, 0);
  +
  +    he->tag = RPMTAG_LICENSE;
  +    he->p.str = license;
       xx = hae(h, he, 0);
   
       he->tag = RPMTAG_SIZE;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/hdrinline.h
  ============================================================================
  $ cvs diff -u -r1.29 -r1.30 hdrinline.h
  --- rpm/rpmdb/hdrinline.h	11 Nov 2007 23:59:20 -0000	1.29
  +++ rpm/rpmdb/hdrinline.h	12 Nov 2007 18:29:21 -0000	1.30
  @@ -390,29 +390,6 @@
   }
   
   /** \ingroup header
  - * Retrieve tag value using header internal array.
  - * Get an entry using as little extra RAM as possible to return the tag value.
  - * This is only an issue for RPM_STRING_ARRAY_TYPE.
  - *
  - * @param h		header
  - * @param tag		tag
  - * @retval *type	tag value data type (or NULL)
  - * @retval *p		tag value(s) (or NULL)
  - * @retval *c		number of values (or NULL)
  - * @return		1 on success, 0 on failure
  - */
  -/*@unused@*/ static inline
  -int headerGetEntryMinMemory(Header h, uint32_t tag,
  -			/*@null@*/ /*@out@*/ hTYP_t type,
  -			/*@null@*/ /*@out@*/ hRET_t * p, 
  -			/*@null@*/ /*@out@*/ hCNT_t c)
  -	/*@modifies *type, *p, *c @*/
  -{
  -    if (h == NULL) return 0;
  -    return (h2hv(h)->hdrgetmin) (h, tag, type, p, c);
  -}
  -
  -/** \ingroup header
    * Add tag to header.
    * Duplicate tags are okay, but only defined for iteration (with the
    * exceptions noted below). While you are allowed to add i18n string
  @@ -438,9 +415,7 @@
   /** \ingroup header
    * Append element to tag array in header.
    * Appends item p to entry w/ tag and type as passed. Won't work on
  - * RPM_STRING_TYPE. Any pointers into header memory returned from
  - * headerGetEntryMinMemory() for this entry are invalid after this
  - * call has been made!
  + * RPM_STRING_TYPE.
    *
    * @param h		header
    * @param tag		tag
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.116 -r1.117 header.c
  --- rpm/rpmdb/header.c	12 Nov 2007 13:54:49 -0000	1.116
  +++ rpm/rpmdb/header.c	12 Nov 2007 18:29:21 -0000	1.117
  @@ -1974,36 +1974,6 @@
       return rc;
   }
   
  -/** \ingroup header
  - * Retrieve tag value using header internal array.
  - * Get an entry using as little extra RAM as possible to return the tag value.
  - * This is only an issue for RPM_STRING_ARRAY_TYPE.
  - *
  - * @param h		header
  - * @param tag		tag
  - * @retval *type	tag value data type (or NULL)
  - * @retval *p		tag value(s) (or NULL)
  - * @retval *c		number of values (or NULL)
  - * @return		1 on success, 0 on failure
  - */
  -static
  -int headerGetEntryMinMemory(Header h, uint32_t tag,
  -			/*@null@*/ /*@out@*/ hTYP_t type,
  -			/*@null@*/ /*@out@*/ hRET_t * p,
  -			/*@null@*/ /*@out@*/ hCNT_t c)
  -	/*@modifies *type, *p, *c @*/
  -	/*@requires maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/
  -{
  -    void * sw;
  -    int rc;
  -
  -    if ((sw = headerGetStats(h, 19)) != NULL)	/* RPMTS_OP_HDRGET */
  -	(void) rpmswEnter(sw, 0);
  -    rc = intGetEntry(h, tag, (rpmTagType *)type, (rpmTagData *)p, (rpmTagCount *)c, 1);
  -    if (sw != NULL)	(void) rpmswExit(sw, 0);
  -    return rc;
  -}
  -
   /**
    */
   static void copyData(rpmTagType type, rpmTagData * dest, rpmTagData * src,
  @@ -2121,9 +2091,7 @@
   /** \ingroup header
    * Append element to tag array in header.
    * Appends item p to entry w/ tag and type as passed. Won't work on
  - * RPM_STRING_TYPE. Any pointers into header memory returned from
  - * headerGetEntryMinMemory() for this entry are invalid after this
  - * call has been made!
  + * RPM_STRING_TYPE.
    *
    * @param h		header
    * @param tag		tag
  @@ -4020,7 +3988,7 @@
   	rpmTagCount c;
   	if (headerIsEntry(headerTo, *tagno))
   	    continue;
  -	if (!headerGetEntryMinMemory(headerFrom, *tagno, (hTYP_t)&t, &p, &c))
  +	if (!headerGetEntry(headerFrom, *tagno, (hTYP_t)&t, &p, &c))
   	    continue;
   	(void) headerAddEntry(headerTo, *tagno, t, p.ptr, c);
   	p.ptr = headerFreeData(p.ptr, t);
  @@ -4047,7 +4015,6 @@
       headerFreeTag,
       headerGetExtension,
       headerGetEntry,
  -    headerGetEntryMinMemory,
       headerAddEntry,
       headerAppendEntry,
       headerAddOrAppendEntry,
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.h
  ============================================================================
  $ cvs diff -u -r1.61 -r1.62 header.h
  --- rpm/rpmdb/header.h	11 Nov 2007 22:07:46 -0000	1.61
  +++ rpm/rpmdb/header.h	12 Nov 2007 18:29:21 -0000	1.62
  @@ -592,25 +592,6 @@
   	/*@modifies *type, *p, *c @*/;
   
   /** \ingroup header
  - * Retrieve tag value using header internal array.
  - * Get an entry using as little extra RAM as possible to return the tag value.
  - * This is only an issue for RPM_STRING_ARRAY_TYPE.
  - *
  - * @param h		header
  - * @param tag		tag
  - * @retval *type	tag value data type (or NULL)
  - * @retval *p		tag value(s) (or NULL)
  - * @retval *c		number of values (or NULL)
  - * @return		1 on success, 0 on failure
  - */
  -typedef
  -int (*HDRgetmin) (Header h, uint32_t tag,
  -			/*@null@*/ /*@out@*/ hTYP_t type,
  -			/*@null@*/ /*@out@*/ hRET_t * p,
  -			/*@null@*/ /*@out@*/ hCNT_t c)
  -	/*@modifies *type, *p, *c @*/;
  -
  -/** \ingroup header
    * Add tag to header.
    * Duplicate tags are okay, but only defined for iteration (with the
    * exceptions noted below). While you are allowed to add i18n string
  @@ -631,9 +612,7 @@
   /** \ingroup header
    * Append element to tag array in header.
    * Appends item p to entry w/ tag and type as passed. Won't work on
  - * RPM_STRING_TYPE. Any pointers into header memory returned from
  - * headerGetEntryMinMemory() for this entry are invalid after this
  - * call has been made!
  + * RPM_STRING_TYPE.
    *
    * @param h		header
    * @param tag		tag
  @@ -869,7 +848,6 @@
       HDRfreetag	hdrfreetag;
       HDRext	hdrext;
       HDRget	hdrget;
  -    HDRgetmin	hdrgetmin;
       HDRadd	hdradd;
       HDRappend	hdrappend;
       HDRaddorappend hdraddorappend;
  @@ .
Received on Mon Nov 12 19:29:22 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.