On Fri, 31 Oct 2003 07:25:33 -0800 (PST) Brett Schwarz [Brett] wrote: Brett> thanks for the patch Alain. Unfortunately, my test Brett> server is packed away in storage so I can't Brett> verify...but I trust you :). thanks :-) one more thing: the script doesn't work if using it like this: ./syncRpms.py /folder list instead of: ./syncRpms.py /folder/ list so here is the updated patch ;-) --------8<------ cut here ------------------8<--------- --- syncRpms.py 2003-10-31 14:00:40.000000000 +0100 +++ syncRpms.py.rh9 2003-10-31 16:40:02.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 = {} -for fname in glob.glob(tgtdir + '*.rpm'): +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<--------- -- Alain