# arekm, 2008
# remove
+from __future__ import print_function
+
import os
import re
import time
try:
fd1 = os.open(os.path.join(dir, f1), os.O_RDONLY)
except Exception, e:
- print e
+ print(e)
# ignore non-files
return 0
try:
fd2 = os.open(os.path.join(dir, f2), os.O_RDONLY)
except Exception, e:
- print e
+ print(e)
# ignore non-files
return 0
h1 = ts.hdrFromFdno(fd1)
m = re_nvr.match(file)
if not m:
- print "problem with: %s" % file
+ print("problem with: %s" % file)
sys.exit(1)
if len(sys.argv) == 0:
else:
files[name] = file
-for i in dupes.iterkeys():
+for i in iter(dupes.keys()):
for old in find_old(dupes[i])[1:]:
os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py .archive/PLD %s" % old)
# arekm, 2008
# remove
+from __future__ import print_function
+
import os
import re
import time
m = re_nvr.match(file)
if not m:
- print "problem with: %s" % file
+ print("problem with: %s" % file)
sys.exit(1)
if len(sys.argv) == 0:
else:
files[name] = file
-for i in dupes.iterkeys():
+for i in iter(dupes.keys()):
for old in find_old(dupes[i])[1:]:
os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py test %s" % old)
# arekm, 2008
# remove
+from __future__ import print_function
+
import os
import re
import time
try:
fd1 = os.open(os.path.join(dir, f1), os.O_RDONLY)
except Exception, e:
- print e
+ print(e)
# ignore non-files
return 0
try:
fd2 = os.open(os.path.join(dir, f2), os.O_RDONLY)
except Exception, e:
- print e
+ print(e)
# ignore non-files
return 0
try:
h1 = ts.hdrFromFdno(fd1)
except Exception, e:
- print "hdrFromFdno for %s failed: %s" % (f1, e)
+ print("hdrFromFdno for %s failed: %s" % (f1, e))
os.close(fd1)
os.close(fd2)
return 0
try:
h2 = ts.hdrFromFdno(fd2)
except Exception, e:
- print "hdrFromFdno for %s failed: %s" % (f2, e)
+ print("hdrFromFdno for %s failed: %s" % (f2, e))
os.close(fd1)
os.close(fd2)
return 0
m = re_nvr.match(file)
if not m:
- print "problem with: %s" % file
+ print("problem with: %s" % file)
sys.exit(1)
if len(sys.argv) == 0:
else:
files[name] = file
-for i in dupes.iterkeys():
+for i in iter(dupes.keys()):
for old in find_old(dupes[i])[1:]:
- print "removing: %s" % old
+ print("removing: %s" % old)
os.system("/home/pld/admins/th/pld-ftp-admin/scripts/remove.py test %s" % old)
#!/usr/bin/python
+from __future__ import print_function
+
import os
import re
try:
hdr = ts.hdrFromFdno(fdno)
except Exception, e:
- print "hdrFromFdno: %s: %s" % (rpm_file, 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)
#!/usr/bin/python
# arekm, 2007
+from __future__ import print_function
+
import os
import rpm
import subprocess
for macro in ['rel', '_rel', 'snap', '_snap', 'rc', '_rc', 'subver', 'githash']:
rpm.delMacro(macro)
macros = rpm.getMacros()
- for macro in macros.iterkeys():
+ for macro in iter(macros.keys()):
if macro[:5] == 'with_' or macro[:8] == 'without_':
rpm.delMacro(macro.split()[0])
def __get_from_cvs(self, name):
spec = os.path.join(specsdir, name + '.spec')
if not os.path.isfile(spec):
- print >>sys.stderr, 'Spec file does not exist: %s' % spec
+ print('Spec file does not exist: %s' % spec, file=sys.stderr)
return ('','','')
- print >>sys.stderr, 'Processing: %s.spec' % name
+ print('Processing: %s.spec' % name, file=sys.stderr)
self.__clean_macros()
try:
s = self.ts.parseSpec(spec)
release = header[rpm.RPMTAG_RELEASE].partition('@')[0]
return (name, version, release)
except rpm.error:
- print >>sys.stderr, 'Failed to parse: %s.spec' % name
+ print('Failed to parse: %s.spec' % name, file=sys.stderr)
return ('','','')
def __update_cvs(self, name):
ver_frac += msg
else:
ver_int += msg
- print ver_int
- print ver_frac
+ print(ver_int)
+ print(ver_frac)
def print_nv(self):
ver_int = "*** VERSION COMPARE ONLY ***\n"
ver_frac += msg
else:
ver_int += msg
- print ver_int
- print ver_frac
+ print(ver_int)
+ print(ver_frac)
p = Pkgs()
p.prepare()
p.print_nv()
-print "\n\n"
+print("\n\n")
p.print_nvr()