[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

extras-buildsys/utils/pushscript Utils.py,1.18,1.19



Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31133

Modified Files:
	Utils.py 
Log Message:
Add simple get_pkg_header(rpm) for access to rpm package headers.


Index: Utils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Utils.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Utils.py	19 Mar 2007 22:53:53 -0000	1.18
+++ Utils.py	6 May 2007 15:54:05 -0000	1.19
@@ -296,13 +296,19 @@
         shutil.rmtree(tmpdir)
 
 
-def naevr(pkg):
-    """return nevra from the package srpm"""
+def get_pkg_header(pkg):
+    """return RPM header dict for a package"""
     try:
         hdr = rpmUtils.miscutils.hdrFromPackage(ts, pkg)
     except rpmUtils.RpmUtilsError:
         print 'WARNING: %s is BAD' % pkg
         raise
+    return hdr
+
+
+def naevr(pkg):
+    """return nevra from the package header"""
+    hdr = get_pkg_header(pkg)
     name = hdr['name']
     ver = hdr['version']
     rel = hdr['release']


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]