Re: test if repomd up to date?

Christoph Thiel <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
On Wed, 2 Nov 2005, Erich Focht wrote:

> thanks for the reply. How am I supposed to use cachedir? My attempts 
> failed:
> 
> focht/bin> createrepo --cachedir /media/usbdisk/SuSE9.3/repodata/repocache/ /media/usbdisk/SuSE9.3/
> Traceback (most recent call last):
>   File "/usr/share/createrepo/genpkgmetadata.py", line 485, in ?
>     main(sys.argv[1:])
>   File "/usr/share/createrepo/genpkgmetadata.py", line 417, in main
>     doPkgMetadata(cmds, ts)
>   File "/usr/share/createrepo/genpkgmetadata.py", line 266, in doPkgMetadata
>     mdobj = dumpMetadata.RpmMetaData(ts, file, cmds)
>   File "/usr/share/createrepo/dumpMetadata.py", line 231, in __init__
>     self.pkgid = self.doChecksumCache(fo)
>   File "/usr/share/createrepo/dumpMetadata.py", line 565, in doChecksumCache
>     csumtag = '%s-%s' % (self.hdr['name'] , self.hdr['hdrid'])
> KeyError: 'unknown header tag'

The "hdrid" header alias isn't available in the rpm (4.1.1) on SUSE Linux 
9.3. But you could simply patch up your createrepo to use 
"rpm.RPMTAG_SHA1HEADER" instead.

I'v attached the patch we currently apply to our createrepo package on 
SUSE Linux.


Regards
	Christoph

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
createrepo-0.4.3.diff (text/plain, 957 B)
--- dumpMetadata.py
+++ dumpMetadata.py
@@ -562,7 +562,7 @@
         if not self.options['cache']:
             return getChecksum(self.options['sumtype'], fo)
         
-        csumtag = '%s-%s' % (self.hdr['name'] , self.hdr['hdrid'])
+        csumtag = '%s-%s' % (self.hdr['name'] , self.hdr[rpm.RPMTAG_SHA1HEADER])
         csumfile = '%s/%s' % (self.options['cachedir'], csumtag)
         if os.path.exists(csumfile):
             csumo = open(csumfile, 'r')
--- genpkgmetadata.py
+++ genpkgmetadata.py
@@ -202,6 +202,8 @@
                 errorprint(_('This option is deprecated'))
             elif arg in ['-c', '--cachedir']:
                 cmds['cache'] = True
+                if not os.path.isabs(a):
+                    a = os.path.join(os.getcwd(), a)
                 cmds['cachedir'] = a
                 if not checkAndMakeDir(a):
                     errorprint(_('Error: cannot open/write to cache dir %s' % a))
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.