upgradecheck upgradecheck.py,1.20,1.21
Ville Skytta (scop)
fedora-extras-commits at redhat.com
Tue Sep 12 20:07:33 UTC 2006
Author: scop
Update of /cvs/fedora/upgradecheck
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4640
Modified Files:
upgradecheck.py
Log Message:
Report only the exact problematic paths found, not all dists/versions from
the first problem spot onwards. Also check paths to all future dist versions
by default instead of the next one only (-x can be used for that).
Index: upgradecheck.py
===================================================================
RCS file: /cvs/fedora/upgradecheck/upgradecheck.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- upgradecheck.py 12 Sep 2006 19:56:17 -0000 1.20
+++ upgradecheck.py 12 Sep 2006 20:07:30 -0000 1.21
@@ -45,26 +45,36 @@
# Architectures to operate on.
archs = rpmUtils.arch.getArchList('src')
-# False positive workaround: per-dist lists of package names that produce
-# false positives. Include only the exact problem spots here.
-known_good = {'4': ['koffice']}
+# False positive workarounds until obsoletes processing is implemented
+# (not really doable as long as we operate on SRPMS): per-package tuples of
+# known good paths
+known_good = {
+ 'koffice': (('FL3-updates', 'FE4'),
+ ('FL3-updates', 'FE5'),
+ ('FL3-updates', 'FE6'),
+ ),
+ }
# Where to checkout owners/owners.list
ownersworkdir = '/srv/extras-push/work'
+
def parseArgs():
usage = "usage: %s [options (see -h)]" % sys.argv[0]
parser = OptionParser(usage=usage)
parser.add_option("-c", "--config", default='/etc/yum.conf',
- help='config file to use (defaults to /etc/yum.conf)')
- parser.add_option("-t", "--tempcache", default=False, action="store_true",
- help="Use a temp dir for storing/accessing yum-cache")
- parser.add_option("-d", "--cachedir", default='',
- help="specify a custom directory for storing/accessing yum-cache")
- parser.add_option("-q", "--quiet", default=0, action="store_true",
+ help='config file to use (defaults to /etc/yum.conf)')
+ parser.add_option("-t", "--tempcache", default=False, action="store_true",
+ help="Use a temp dir for storing/accessing yum-cache")
+ parser.add_option("-d", "--cachedir", default='',
+ help="custom directory for storing/accessing yum-cache")
+ parser.add_option("-q", "--quiet", default=0, action="store_true",
help="quiet (no output to stderr)")
parser.add_option("-n", "--nomail", default=False, action="store_true",
help="do not send mail, just output the results")
+ parser.add_option("-x", "--nextonly", default=0, action="store_true",
+ help="check next dist version only for each package, "
+ "not all newer ones")
(opts, args) = parser.parse_args()
return (opts, args)
@@ -150,32 +160,34 @@
report = []
reports = {} # report per owner, key is owner email addr
- for dist in enabled_dists:
- if not known_good.get(dist):
- known_good[dist] = []
-
for name in allnames:
pkgdata = map(lambda x: pkgdict[x].get(name), enabled_dists)
- last = None # last seen EVR
- bork = None # index of first repo w/ problem
- ix = 0
- for curr in pkgdata:
- if not curr or not last:
- # package missing from this repo or nothing to compare against
- # TODO: detect holes in continuum
- pass
- elif name in known_good[enabled_dists[ix]]:
- # "known good" workaround -> skip compare
- pass
- elif compareEVR(last, curr["evr"]) > 0:
- # versioning problem
- bork = ix - 1
- break
- if curr:
- last = curr["evr"]
- ix = ix + 1
- if bork is not None:
- ix = bork
+ broken_paths = []
+
+ for i in range(len(pkgdata)):
+ curr = pkgdata[i]
+ if not curr:
+ # package missing from this dist, skip
+ continue
+
+ for next in pkgdata[i+1:]:
+ if not next:
+ # package missing from this dist, skip
+ # TODO: warn about holes in continuum?
+ continue
+
+ if compareEVR(curr["evr"], next["evr"]) > 0:
+ # candidate for brokenness
+ if not known_good.has_key(name):
+ known_good[name] = ()
+ if (curr["repo"], next["repo"]) not in known_good[name]:
+ # yep, it's broken
+ broken_paths.append((curr, next))
+
+ if opts.nextonly:
+ break
+
+ if broken_paths:
owner = owners[name]
if owner == '':
owner = 'UNKNOWN OWNER (possibly Core package)'
@@ -183,13 +195,13 @@
if not reports.has_key(owner):
reports[owner] = []
reports[owner].append(name)
- report.append(name+': '+ownerprint)
- for curr in pkgdata[ix:]: # onwards from the problem spot
- if curr: # we haven't checked if all distros after the bork spot have this package
- what = " %s: %s (%s)" % (enabled_dists[ix], evrstr(curr["evr"]), curr["repo"])
- reports[owner].append(what)
- report.append(what)
- ix = ix + 1
+ report.append("%s: %s" % (name, ownerprint))
+ for broken in broken_paths:
+ what = " %s < %s (%s < %s)" % \
+ (broken[0]["repo"], broken[1]["repo"],
+ evrstr(broken[0]["evr"]), evrstr(broken[1]["evr"]))
+ reports[owner].append(what)
+ report.append(what)
reports[owner].append("")
report.append("")
More information about the scm-commits
mailing list