#!/usr/bin/python
+from __future__ import print_function
+
import os
import re
import rpm
-dirs = ['/home/services/ftp/pld/dists/3.0/PLD/i486/RPMS',
+dirs = ['/home/services/ftp/pld/dists/3.0/PLD/x32/RPMS',
'/home/services/ftp/pld/dists/3.0/PLD/i686/RPMS',
'/home/services/ftp/pld/dists/3.0/PLD/x86_64/RPMS',
- '/home/services/ftp/pld/dists/3.0/ready/i486/RPMS',
+ '/home/services/ftp/pld/dists/3.0/ready/x32/RPMS',
'/home/services/ftp/pld/dists/3.0/ready/i686/RPMS',
'/home/services/ftp/pld/dists/3.0/ready/x86_64/RPMS',
- '/home/services/ftp/pld/dists/3.0/test/i486/RPMS',
+ '/home/services/ftp/pld/dists/3.0/test/x32/RPMS',
'/home/services/ftp/pld/dists/3.0/test/i686/RPMS',
'/home/services/ftp/pld/dists/3.0/test/x86_64/RPMS']
fdno = os.open(rpm_file, os.O_RDONLY)
try:
hdr = ts.hdrFromFdno(fdno)
- except Exception, e:
- print "hdrFromFdno: %s: %s" % (rpm_file, e)
+ except Exception as e:
+ print("hdrFromFdno: %s: %s" % (rpm_file, e))
os.close(fdno)
continue
os.close(fdno)
sourcerpm = hdr[rpm.RPMTAG_SOURCERPM]
m = re_nvr.match(sourcerpm)
if not m:
- print "%s: doesn't match src.rpm file name" % (sourcerpm)
+ print("%s: doesn't match src.rpm file name" % (sourcerpm))
continue
srcname = m.group(1)
pkgs[name] = srcname
f = open(outname + ".tmp", "w")
-for (pkg, spkg) in pkgs.iteritems():
+for (pkg, spkg) in iter(pkgs.items()):
f.write("%s:%s\n" % (pkg, spkg))
f.close()
os.chmod(outname + ".tmp", 0644)