apt lorg3 on RH9

Panu Matilainen pmatilai at laiskiainen.org
Thu Apr 27 02:43:27 PDT 2006


On Thu, 27 Apr 2006, Panu Matilainen wrote:
> The question then is, does that break yum, smart or other depsolvers/tools 
> supporting repomd? I don't know. I guess I could ask on the repomd list (and 
> expect to be flamed to hell for bringing back that old epoch issue which most 
> people have blissfully forgotten by now)

Oh well, yum does blow up if epochs are removed from the metadata :-/
Smart I can't currently test.

Traceback (most recent call last):
   File "/usr/bin/yum", line 29, in ?
     yummain.main(sys.argv[1:])
   File "/usr/share/yum-cli/yummain.py", line 92, in main
     result, resultmsgs = do()
   File "/usr/share/yum-cli/cli.py", line 471, in doCommands
     return self.updatePkgs()
   File "/usr/share/yum-cli/cli.py", line 949, in updatePkgs
     self.doRepoSetup()
   File "/usr/share/yum-cli/cli.py", line 75, in doRepoSetup
     self.doSackSetup(thisrepo=thisrepo)
   File "/usr/lib/python2.3/site-packages/PIL/__init__.py", line 267, in 
doSackSetup

   File "repos.py", line 287, in populateSack
   File "sqlitecache.py", line 96, in getPrimary
   File "sqlitecache.py", line 89, in _getbase
   File "sqlitecache.py", line 359, in updateSqliteCache
   File "sqlitecache.py", line 251, in addPrimary
   File "sqlitecache.py", line 197, in insertHash
   File "sqlitecache.py", line 449, in values
   File "sqlitecache.py", line 441, in __getitem__
   File "mdparser.py", line 73, in __getitem__
KeyError: 'epoch'

It'd probably be trivial to fix in yum, the question is more probably is 
there any interested in complicating their code which wont run on those 
old releases anyhow ...

OTOH if you only use apt (especially for those old releases) patching 
createrepo might not be that bad (attached if anybody wants to play around 
with it). Oh and you'll want to apply the "epochs everywhere" patch to 
apt-rpm to stop it messing with existence of epochs. With the that and 
repository created with patched createrepo I *think* it should "just work" 
with any old version.

 	- Panu -
-------------- next part --------------
--- createrepo-0.4.4/dumpMetadata.py.epoch	2006-04-27 12:28:01.000000000 +0300
+++ createrepo-0.4.4/dumpMetadata.py	2006-04-27 12:29:13.000000000 +0300
@@ -323,7 +323,7 @@
         if i != -1:
             epoch = strng[:i]
         else:
-            epoch = '0'
+            epoch = None
         j = strng.find('-')
         if j != -1:
             if strng[i + 1:j] == '':
@@ -438,7 +438,7 @@
         
     def epoch(self):
         if self.hdr['epoch'] is None:
-            return 0
+            return None
         else:
             return self.tagByName('epoch')
             
@@ -592,7 +592,8 @@
     pkgNode.newChild(None, 'name', rpmObj.tagByName('name'))
     pkgNode.newChild(None, 'arch', rpmObj.arch())
     version = pkgNode.newChild(None, 'version', None)
-    version.newProp('epoch', str(rpmObj.epoch()))
+    if rpmObj.epoch():
+        version.newProp('epoch', str(rpmObj.epoch()))
     version.newProp('ver', str(rpmObj.tagByName('version')))
     version.newProp('rel', str(rpmObj.tagByName('release')))
     csum = pkgNode.newChild(None, 'checksum', rpmObj.pkgid)
@@ -696,7 +697,8 @@
     pkg.newProp('name', rpmObj.tagByName('name'))
     pkg.newProp('arch', rpmObj.arch())
     version = pkg.newChild(None, 'version', None)
-    version.newProp('epoch', str(rpmObj.epoch()))
+    if rpmObj.epoch():
+        version.newProp('epoch', str(rpmObj.epoch()))
     version.newProp('ver', str(rpmObj.tagByName('version')))
     version.newProp('rel', str(rpmObj.tagByName('release')))
     for file in rpmObj.filenames:
@@ -721,7 +723,8 @@
     pkg.newProp('name', rpmObj.tagByName('name'))
     pkg.newProp('arch', rpmObj.arch())
     version = pkg.newChild(None, 'version', None)
-    version.newProp('epoch', str(rpmObj.epoch()))
+    if rpmObj.epoch():
+        version.newProp('epoch', str(rpmObj.epoch()))
     version.newProp('ver', str(rpmObj.tagByName('version')))
     version.newProp('rel', str(rpmObj.tagByName('release')))
     clogs = rpmObj.changelogLists()


More information about the Apt-Rpm mailing list