[yum-cvs] yum-utils/plugins/changelog changelog.py,1.9,1.10
Tim Lauridsen
timlau at linux.duke.edu
Fri Sep 29 11:51:30 UTC 2006
Update of /home/groups/yum/cvs/yum-utils/plugins/changelog
In directory login1.linux.duke.edu:/tmp/cvs-serv23520/plugins/changelog
Modified Files:
changelog.py
Log Message:
fixed plugin to work with current API without deprecation warnings
Index: changelog.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/plugins/changelog/changelog.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- changelog.py 5 Sep 2006 18:53:29 -0000 1.9
+++ changelog.py 29 Sep 2006 11:51:28 -0000 1.10
@@ -22,7 +22,7 @@
from rpmUtils.miscutils import splitFilename
from yum.plugins import TYPE_INTERFACE
-requires_api_version = '2.1'
+requires_api_version = '2.5'
plugin_type = (TYPE_INTERFACE,)
origpkgs = {}
@@ -85,16 +85,15 @@
ts = conduit.getTsInfo()
rpmdb = conduit.getRpmDB()
for tsmem in ts.getMembers():
- for pkgtup in rpmdb.returnTupleByKeyword(name=tsmem.po.name, arch=tsmem.po.arch):
- for hdr in rpmdb.returnHeaderByTuple(pkgtup):
- # store the latest date in changelog entries
- times = hdr['changelogtime']
- n,v,r,e,a = splitFilename(hdr['sourcerpm'])
- if len(times) == 0:
- # deal with packages without changelog
- origpkgs[n] = 0
- else:
- origpkgs[n] = times[0]
+ for po in rpmdb.searchNevra(name=tsmem.po.name, arch=tsmem.po.arch):
+ hdr = po.hdr
+ times = hdr['changelogtime']
+ n,v,r,e,a = splitFilename(hdr['sourcerpm'])
+ if len(times) == 0:
+ # deal with packages without changelog
+ origpkgs[n] = 0
+ else:
+ origpkgs[n] = times[0]
if conduit.confString('main', 'when', default='post') == 'pre':
show_changes(conduit, 'Changes in packages about to be updated:')
More information about the Yum-cvs-commits
mailing list