Re: syncRpms.py error...need help

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

 



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




[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux