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

Re: syncRpms.py error...need help



On Fri, 31 Oct 2003 17:19:15 +0530
Gautam Pagedar [Gautam] wrote:

Gautam> Hi Alain,
Gautam> 

hi,

hereafter is a patch for your script:

--------8<------ cut here ------------------8<---------
--- syncRpms.py 2003-10-31 14:00:40.000000000 +0100
+++ syncRpms.py.rh9     2003-10-31 14:01:31.000000000 +0100
@@ -27,7 +27,7 @@
 #      02111-1307  USA
 #
 
-import rpm404 as rpm
+import rpm
 import sys, os, glob
 
 if len(sys.argv) != 3:
@@ -42,10 +42,11 @@
 #       get pkg name to file name mapping
 #
 name2file = {}
+ts = rpm.TransactionSet("", rpm._RPMVSF_NOSIGNATURES)
 for fname in glob.glob(tgtdir + '*.rpm'):
         fd = os.open(fname, os.O_RDONLY)
-        (header, isSource) = rpm.headerFromPackage(fd)
-        name2file[header[rpm.RPMTAG_NAME]] = fname
+        hdr = ts.hdrFromFdno(fd)
+        name2file[hdr[rpm.RPMTAG_NAME]] = fname
         os.close(fd)
 
 #
--------8<------ cut here ------------------8<---------

works fine on my rh9.

-- 
Alain




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