Re: CVS access problem

Jeff Johnson <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
Hint:

RPMTAG_PKGID (i.e. the header+payload MD5, aka RPMTAG_SIGMD5) is  
universally available
in *.rpm packages, and (unlike the *.rpm file md5sum that was once  
used by repo-md) is invariant
to signing events.

For package tracking/hashing purposes, whether md5 collisions can be  
generated Simply Does Not Matter.

If you must track headers differently than packages, then the header  
SHA1 can be computed on
the fly for the few remaining ancient rpm-3.0.x produced packages  
that are encountered.

I have no idea why the patch below is looking at RSAHEADER/DSAHEADER/ 
SIGPGP/SIGGPG tags,
what is needed is a strong guarantee of uniqueness for an identifier,  
and that is RPMTAG_PKGID
(aka RPMTAG_SIGMD5).

All dutifully delivered to this list way back when, and now  
regurgitated again again again.

Have fun!

73 de Jeff

On Jun 28, 2006, at 11:22 AM, Hans-Peter Jansen wrote:

> Am Mittwoch, 28. Juni 2006 15:29 schrieb seth vidal:
>> On Wed, 2006-06-28 at 14:24 +0200, Hans-Peter Jansen wrote:
>>> Hi Seth,
>>
>> once more, with feeling, please test it out.
>
> Well, actually it takes a commit to see the difference. How about  
> this one:
>
> --- dumpMetadata.py.orig	2006-06-10 01:31:04.000000000 +0200
> +++ dumpMetadata.py	2006-06-28 17:02:21.804109025 +0200
> @@ -570,7 +570,29 @@ class RpmMetaData:
>          if not self.options['cache']:
>              return getChecksum(self.options['sumtype'], fo)
>
> -        csumtag = '%s-%s' % (self.hdr['name'] , self.hdr 
> [rpm.RPMTAG_SHA1HEADER])
> +        # grabbing the checksum can be easy..
> +        key = None
> +        for h in (rpm.RPMTAG_SHA1HEADER, rpm.RPMTAG_RSAHEADER,  
> rpm.RPMTAG_DSAHEADER):
> +            key = self.hdr[h]
> +            if key:
> +                break
> +
> +        # ..or taking a bit more effort
> +        if not key:
> +            for h in (rpm.RPMTAG_SIGPGP, rpm.RPMTAG_SIGMD5,  
> rpm.RPMTAG_SIGGPG):
> +                key = self.hdr[h]
> +                if key:
> +                    # generate hexdigest from signature
> +                    key = "".join([hex(ord(x))[2:].zfill(2)
> +                                for x in tuple(self.hdr[h])])
> +                    break
> +
> +        # still no go? bail out
> +        if not key:
> +            raise MDError, "Error determining the rpm pkg chksum/ 
> signature from %s " % \
> +                            self.hdr['name']
> +
> +        csumtag = '%s-%s' % (self.hdr['name'], key)
>          csumfile = '%s/%s' % (self.options['cachedir'], csumtag)
>          if os.path.exists(csumfile) and self.mtime <= os.stat 
> (csumfile)[8]:
>              csumo = open(csumfile, 'r')
> --- ChangeLog~	2006-06-28 14:13:32.000000000 +0200
> +++ ChangeLog	2006-06-28 17:07:40.272558470 +0200
> @@ -1,3 +1,9 @@
> +2006-06-28 17:03  [email protected]
> +
> +	* dumpMetadata.py:
> +	forward port the more robust rpm header chksum/signature retrieval
> +	procedure and bail out on failure
> +
>  2006-06-15 11:39  lmacken
>
>  	* ChangeLog, genpkgmetadata.py, docs/createrepo.8: 2006-06-15 11:40
>
>
> ;-),
> Pete
> _______________________________________________
> Rpm-metadata mailing list
> [email protected]
> https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.