RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ librpm.vers package.c rpmts.c rpmts.h

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 29 Sep 2007 - 02:07:44 CEST
Message-Id: <20070929000744.A4770348469@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:   29-Sep-2007 02:07:44
  Branch: HEAD                             Handle: 2007092901074300

  Modified files:
    rpm                     CHANGES
    rpm/lib                 librpm.vers package.c rpmts.c rpmts.h

  Log:
    - eliminate rpmtsSigFoo() getters.

  Summary:
    Revision    Changes     Path
    1.1644      +1  -0      rpm/CHANGES
    1.18        +0  -5      rpm/lib/librpm.vers
    2.160       +10 -17     rpm/lib/package.c
    2.99        +1  -26     rpm/lib/rpmts.c
    2.75        +0  -42     rpm/lib/rpmts.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1643 -r1.1644 CHANGES
  --- rpm/CHANGES	28 Sep 2007 23:27:26 -0000	1.1643
  +++ rpm/CHANGES	29 Sep 2007 00:07:43 -0000	1.1644
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: eliminate rpmtsSigFoo() getters.
       - jbj: finish refactoring vsflags out of rpmts.
       - rpm.org: rename fileTypes_e and whatis() (for name spacing).
       - jbj: move (largely unused) fileTypes into rpmfi.h.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/librpm.vers
  ============================================================================
  $ cvs diff -u -r1.17 -r1.18 librpm.vers
  --- rpm/lib/librpm.vers	28 Sep 2007 22:26:49 -0000	1.17
  +++ rpm/lib/librpm.vers	29 Sep 2007 00:07:43 -0000	1.18
  @@ -394,11 +394,6 @@
       rpmtsSetTid;
       rpmtsSetType;
       rpmtsSetVSFlags;
  -    rpmtsSig;
  -    rpmtsSiglen;
  -    rpmtsSignature;
  -    rpmtsSigtag;
  -    rpmtsSigtype;
       rpmtsSolve;
       rpmtsSpec;
       _rpmts_stats;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/package.c
  ============================================================================
  $ cvs diff -u -r2.159 -r2.160 package.c
  --- rpm/lib/package.c	9 Sep 2007 20:32:42 -0000	2.159
  +++ rpm/lib/package.c	29 Sep 2007 00:07:43 -0000	2.160
  @@ -197,16 +197,15 @@
   
   /**
    * Remember current key id.
  - * @param ts		transaction set
  + * @param dig		container
    * @return		0 if new keyid, otherwise 1
    */
  -static int rpmtsStashKeyid(rpmts ts)
  +static int pgpStashKeyid(pgpDig dig)
   	/*@globals nextkeyid, nkeyids, keyids @*/
   	/*@modifies nextkeyid, nkeyids, keyids @*/
   {
  -    const void * sig = rpmtsSig(ts);
  -    pgpDig dig = rpmtsDig(ts);
       pgpDigParams sigp = pgpGetSignature(dig);
  +    const void * sig = pgpGetSig(dig);
       unsigned int keyid;
       int i;
   
  @@ -254,7 +253,7 @@
    */
   rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, const char ** msg)
   {
  -    pgpDig dig;
  +    pgpDig dig = rpmtsDig(ts);
       char buf[8*BUFSIZ];
       int_32 * ei = (int_32 *) uh;
   /*@-boundsread@*/
  @@ -271,7 +270,7 @@
       entryInfo info = memset(alloca(sizeof(*info)), 0, sizeof(*info));
       const void * sig = NULL;
       unsigned char * b;
  -    rpmVSFlags vsflags = rpmtsVSFlags(ts);
  +    rpmVSFlags vsflags = pgpGetVSFlags(dig);
       rpmop op;
       int siglen = 0;
       int blen;
  @@ -458,9 +457,7 @@
       }
   
       /* Verify header-only digest/signature. */
  -    dig = rpmtsDig(ts);
  -    if (dig == NULL)
  -	goto verifyinfo_exit;
  +assert(dig);
       dig->nbytes = 0;
   
   /*@-boundsread@*/
  @@ -698,7 +695,7 @@
   rpmRC rpmReadPackageFile(rpmts ts, void * _fd, const char * fn, Header * hdrp)
   {
       FD_t fd = _fd;
  -    pgpDig dig;
  +    pgpDig dig = rpmtsDig(ts);
       char buf[8*BUFSIZ];
       ssize_t count;
       Header sigh = NULL;
  @@ -786,7 +783,7 @@
        */
       sigtag = 0;
       opx = 0;
  -    vsflags = rpmtsVSFlags(ts);
  +    vsflags = pgpGetVSFlags(dig);
       if (_chk(RPMVSF_NODSAHEADER) && headerIsEntry(sigh, RPMSIGTAG_DSA)) {
   	sigtag = RPMSIGTAG_DSA;
       } else
  @@ -856,11 +853,7 @@
   	goto exit;
       }
   
  -    dig = rpmtsDig(ts);
  -    if (dig == NULL) {
  -	rc = RPMRC_FAIL;
  -	goto exit;
  -    }
  +assert(dig);
       dig->nbytes = 0;
   
       /* Retrieve the tag parameters from the signature header. */
  @@ -1015,7 +1008,7 @@
       case RPMRC_NOTTRUSTED:	/* Signature is OK, but key is not trusted. */
       case RPMRC_NOKEY:		/* Public key is unavailable. */
   	/* XXX Print NOKEY/NOTTRUSTED warning only once. */
  -    {	int lvl = (rpmtsStashKeyid(ts) ? RPMMESS_DEBUG : RPMMESS_WARNING);
  +    {	int lvl = (pgpStashKeyid(dig) ? RPMMESS_DEBUG : RPMMESS_WARNING);
   	rpmMessage(lvl, "%s: %s", fn, buf);
       }	break;
       case RPMRC_NOTFOUND:	/* Signature is unknown type. */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  ============================================================================
  $ cvs diff -u -r2.98 -r2.99 rpmts.c
  --- rpm/lib/rpmts.c	28 Sep 2007 23:27:26 -0000	2.98
  +++ rpm/lib/rpmts.c	29 Sep 2007 00:07:43 -0000	2.99
  @@ -1101,33 +1101,13 @@
       return otid;
   }
   
  -int_32 rpmtsSigtag(const rpmts ts)
  -{
  -    return pgpGetSigtag(rpmtsDig(ts));
  -}
  -
  -int_32 rpmtsSigtype(const rpmts ts)
  -{
  -    return pgpGetSigtype(rpmtsDig(ts));
  -}
  -
  -const void * rpmtsSig(const rpmts ts)
  -{
  -    return pgpGetSig(rpmtsDig(ts));
  -}
  -
  -int_32 rpmtsSiglen(const rpmts ts)
  -{
  -    return pgpGetSiglen(rpmtsDig(ts));
  -}
  -
   int rpmtsSetSig(rpmts ts,
   		int_32 sigtag, int_32 sigtype, const void * sig, int_32 siglen)
   {
       int ret = 0;
       if (ts != NULL) {
   	const void * osig = pgpGetSig(rpmtsDig(ts));
  -	int_32 osigtype = pgpGetSiglen(rpmtsDig(ts));
  +	int_32 osigtype = pgpGetSigtype(rpmtsDig(ts));
   	if (osig && osigtype)
   	    osig = headerFreeData(osig, osigtype);
   	ret = pgpSetSig(rpmtsDig(ts), sigtag, sigtype, sig, siglen);
  @@ -1146,11 +1126,6 @@
       return ts->dig;
   }
   
  -pgpDigParams rpmtsSignature(const rpmts ts)
  -{
  -    return pgpGetSignature(rpmtsDig(ts));
  -}
  -
   pgpDigParams rpmtsPubkey(const rpmts ts)
   {
       return pgpGetPubkey(rpmtsDig(ts));
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.h
  ============================================================================
  $ cvs diff -u -r2.74 -r2.75 rpmts.h
  --- rpm/lib/rpmts.h	28 Sep 2007 23:27:26 -0000	2.74
  +++ rpm/lib/rpmts.h	29 Sep 2007 00:07:43 -0000	2.75
  @@ -687,39 +687,6 @@
   	/*@modifies ts @*/;
   
   /** \ingroup rpmts
  - * Get signature tag.
  - * @param ts		transaction set
  - * @return		signature tag
  - */
  -int_32 rpmtsSigtag(const rpmts ts)
  -	/*@*/;
  -
  -/** \ingroup rpmts
  - * Get signature tag type.
  - * @param ts		transaction set
  - * @return		signature tag type
  - */
  -int_32 rpmtsSigtype(const rpmts ts)
  -	/*@*/;
  -
  -/** \ingroup rpmts
  - * Get signature tag data, i.e. from header.
  - * @param ts		transaction set
  - * @return		signature tag data
  - */
  -/*@observer@*/ /*@null@*/
  -extern const void * rpmtsSig(const rpmts ts)
  -	/*@*/;
  -
  -/** \ingroup rpmts
  - * Get signature tag data length, i.e. no. of bytes of data.
  - * @param ts		transaction set
  - * @return		signature tag data length
  - */
  -int_32 rpmtsSiglen(const rpmts ts)
  -	/*@*/;
  -
  -/** \ingroup rpmts
    * Set signature tag info, i.e. from header.
    * @param ts		transaction set
    * @param sigtag	signature tag
  @@ -743,15 +710,6 @@
   	/*@*/;
   
   /** \ingroup rpmts
  - * Return OpenPGP signature constants.
  - * @param ts		transaction set
  - * @return		signature constants.
  - */
  -/*@exposed@*/ /*@null@*/
  -pgpDigParams rpmtsSignature(const rpmts ts)
  -	/*@*/;
  -
  -/** \ingroup rpmts
    * Return OpenPGP pubkey constants.
    * @param ts		transaction set
    * @return		pubkey constants.
  @@ .
Received on Sat Sep 29 02:07:44 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.