mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-06 07:12:05 +00:00
Minor fixes for excuse generation.
This commit is contained in:
parent
6c39d4e13f
commit
8ba92ccadb
@ -9,8 +9,7 @@ UNSTABLE = ../data/unstable
|
|||||||
EXCUSES_OUTPUT = update.EXCUSES_py
|
EXCUSES_OUTPUT = update.EXCUSES_py
|
||||||
|
|
||||||
# List of release architectures
|
# List of release architectures
|
||||||
# ARCHITECTURES = i386 sparc alpha powerpc arm m68k hppa ia64 mips mipsel s390 amd64
|
ARCHITECTURES = i386 sparc alpha powerpc arm m68k hppa ia64 mips mipsel s390 amd64
|
||||||
ARCHITECTURES = i386 amd64
|
|
||||||
|
|
||||||
# if you're not in this list, arch: all packages are allowed to break on you
|
# if you're not in this list, arch: all packages are allowed to break on you
|
||||||
NOBREAKALL_ARCHES = i386
|
NOBREAKALL_ARCHES = i386
|
||||||
|
56
britney.py
56
britney.py
@ -47,7 +47,7 @@ class Britney:
|
|||||||
'unstable': self.read_sources(self.options.unstable),
|
'unstable': self.read_sources(self.options.unstable),
|
||||||
'tpu': self.read_sources(self.options.tpu),}
|
'tpu': self.read_sources(self.options.tpu),}
|
||||||
self.binaries = {'testing': {}, 'unstable': {}, 'tpu': {}}
|
self.binaries = {'testing': {}, 'unstable': {}, 'tpu': {}}
|
||||||
for arch in self.options.architectures.split():
|
for arch in self.options.architectures:
|
||||||
self.binaries['testing'][arch] = self.read_binaries(self.options.testing, "testing", arch)
|
self.binaries['testing'][arch] = self.read_binaries(self.options.testing, "testing", arch)
|
||||||
self.binaries['unstable'][arch] = self.read_binaries(self.options.unstable, "unstable", arch)
|
self.binaries['unstable'][arch] = self.read_binaries(self.options.unstable, "unstable", arch)
|
||||||
self.binaries['tpu'][arch] = self.read_binaries(self.options.tpu, "tpu", arch)
|
self.binaries['tpu'][arch] = self.read_binaries(self.options.tpu, "tpu", arch)
|
||||||
@ -80,6 +80,13 @@ class Britney:
|
|||||||
reduce(lambda x,y: x+y, [hasattr(self, "HINTS_" + i) and getattr(self, "HINTS_" + i) or (i,) for i in v.split()])
|
reduce(lambda x,y: x+y, [hasattr(self, "HINTS_" + i) and getattr(self, "HINTS_" + i) or (i,) for i in v.split()])
|
||||||
else:
|
else:
|
||||||
setattr(self.options, k.lower(), v)
|
setattr(self.options, k.lower(), v)
|
||||||
|
# Sort architectures
|
||||||
|
allarches = sorted(self.options.architectures.split())
|
||||||
|
arches = [x for x in allarches if x in self.options.nobreakall_arches]
|
||||||
|
arches += [x for x in allarches if x not in arches and x not in self.options.fucked_arches]
|
||||||
|
arches += [x for x in allarches if x not in arches and x not in self.options.break_arches]
|
||||||
|
arches += [x for x in allarches if x not in arches]
|
||||||
|
self.options.architectures = arches
|
||||||
|
|
||||||
def __log(self, msg, type="I"):
|
def __log(self, msg, type="I"):
|
||||||
"""Print info messages according to verbosity level"""
|
"""Print info messages according to verbosity level"""
|
||||||
@ -122,7 +129,7 @@ class Britney:
|
|||||||
maxver = None
|
maxver = None
|
||||||
if self.sources[dist].has_key(pkg):
|
if self.sources[dist].has_key(pkg):
|
||||||
maxver = self.sources[dist][pkg]['version']
|
maxver = self.sources[dist][pkg]['version']
|
||||||
for arch in self.options.architectures.split():
|
for arch in self.options.architectures:
|
||||||
if not self.binaries[dist][arch][0].has_key(pkg): continue
|
if not self.binaries[dist][arch][0].has_key(pkg): continue
|
||||||
pkgv = self.binaries[dist][arch][0][pkg]['version']
|
pkgv = self.binaries[dist][arch][0][pkg]['version']
|
||||||
if maxver == None or apt_pkg.VersionCompare(pkgv, maxver) > 0:
|
if maxver == None or apt_pkg.VersionCompare(pkgv, maxver) > 0:
|
||||||
@ -336,7 +343,6 @@ class Britney:
|
|||||||
|
|
||||||
def get_dependency_solvers(self, block, arch, distribution):
|
def get_dependency_solvers(self, block, arch, distribution):
|
||||||
packages = []
|
packages = []
|
||||||
missing = []
|
|
||||||
|
|
||||||
for name, version, op in block:
|
for name, version, op in block:
|
||||||
real_package = False
|
real_package = False
|
||||||
@ -345,26 +351,20 @@ class Britney:
|
|||||||
package = self.binaries[distribution][arch][0][name]
|
package = self.binaries[distribution][arch][0][name]
|
||||||
if op == '' and version == '' or apt_pkg.CheckDep(package['version'], op, version):
|
if op == '' and version == '' or apt_pkg.CheckDep(package['version'], op, version):
|
||||||
packages.append(name)
|
packages.append(name)
|
||||||
return (True, packages)
|
|
||||||
|
|
||||||
# TODO: this would be enough according to policy, but not according to britney v.1
|
# TODO: this would be enough according to policy, but not according to britney v.1
|
||||||
#if op == '' and version == '' and name in self.binaries['unstable'][arch][1]:
|
#if op == '' and version == '' and name in self.binaries[distribution][arch][1]:
|
||||||
# # packages.extend(self.binaries['unstable'][arch][1][name])
|
# # packages.extend(self.binaries[distribution][arch][1][name])
|
||||||
# return (True, packages)
|
# return (True, packages)
|
||||||
|
|
||||||
if name in self.binaries['unstable'][arch][1]:
|
if name in self.binaries[distribution][arch][1]:
|
||||||
for prov in self.binaries['unstable'][arch][1][name]:
|
for prov in self.binaries[distribution][arch][1][name]:
|
||||||
package = self.binaries['unstable'][arch][0][prov]
|
package = self.binaries[distribution][arch][0][prov]
|
||||||
if op == '' and version == '' or apt_pkg.CheckDep(package['version'], op, version):
|
if op == '' and version == '' or apt_pkg.CheckDep(package['version'], op, version):
|
||||||
packages.append(name)
|
packages.append(prov)
|
||||||
break
|
break
|
||||||
if len(packages) > 0:
|
|
||||||
return (True, packages)
|
|
||||||
|
|
||||||
if real_package:
|
return (len(packages) > 0, packages)
|
||||||
missing.append(name)
|
|
||||||
|
|
||||||
return (False, missing)
|
|
||||||
|
|
||||||
def excuse_unsat_deps(self, pkg, src, arch, suite, excuse, ignore_break=0):
|
def excuse_unsat_deps(self, pkg, src, arch, suite, excuse, ignore_break=0):
|
||||||
binary_u = self.binaries[suite][arch][0][pkg]
|
binary_u = self.binaries[suite][arch][0][pkg]
|
||||||
@ -414,7 +414,7 @@ class Britney:
|
|||||||
self.excuses.append(excuse)
|
self.excuses.append(excuse)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for pkg in source_u['binaries']:
|
for pkg in sorted(source_u['binaries']):
|
||||||
if not pkg.endswith("/" + arch): continue
|
if not pkg.endswith("/" + arch): continue
|
||||||
pkg_name = pkg.split("/")[0]
|
pkg_name = pkg.split("/")[0]
|
||||||
|
|
||||||
@ -423,34 +423,34 @@ class Britney:
|
|||||||
pkgsv = self.binaries[suite][arch][0][pkg_name]['source-ver']
|
pkgsv = self.binaries[suite][arch][0][pkg_name]['source-ver']
|
||||||
|
|
||||||
if binary_u['architecture'] == 'all':
|
if binary_u['architecture'] == 'all':
|
||||||
excuse.addhtml("Ignoring %s %s (from %s) as it is arch: all" % (pkg, binary_u['version'], pkgsv))
|
excuse.addhtml("Ignoring %s %s (from %s) as it is arch: all" % (pkg_name, binary_u['version'], pkgsv))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not self.same_source(source_t['version'], pkgsv):
|
if not self.same_source(source_t['version'], pkgsv):
|
||||||
anywrongver = True
|
anywrongver = True
|
||||||
excuse.addhtml("From wrong source: %s %s (%s not %s)" % (pkg, binary_u['version'], pkgsv, source_t['version']))
|
excuse.addhtml("From wrong source: %s %s (%s not %s)" % (pkg_name, binary_u['version'], pkgsv, source_t['version']))
|
||||||
break
|
break
|
||||||
|
|
||||||
self.excuse_unsat_deps(pkg_name, src, arch, suite, excuse)
|
self.excuse_unsat_deps(pkg_name, src, arch, suite, excuse)
|
||||||
|
|
||||||
if not binary_t:
|
if not binary_t:
|
||||||
excuse.addhtml("New binary: %s (%s)" % (pkg, binary_u['version']))
|
excuse.addhtml("New binary: %s (%s)" % (pkg_name, binary_u['version']))
|
||||||
anyworthdoing = True
|
anyworthdoing = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
vcompare = apt_pkg.VersionCompare(binary_t['version'], binary_u['version'])
|
vcompare = apt_pkg.VersionCompare(binary_t['version'], binary_u['version'])
|
||||||
if vcompare > 0:
|
if vcompare > 0:
|
||||||
anywrongver = True
|
anywrongver = True
|
||||||
excuse.addhtml("Not downgrading: %s (%s to %s)" % (pkg, binary_t['version'], binary_u['version']))
|
excuse.addhtml("Not downgrading: %s (%s to %s)" % (pkg_name, binary_t['version'], binary_u['version']))
|
||||||
break
|
break
|
||||||
elif vcompare < 0:
|
elif vcompare < 0:
|
||||||
excuse.addhtml("Updated binary: %s (%s to %s)" % (pkg, binary_t['version'], binary_u['version']))
|
excuse.addhtml("Updated binary: %s (%s to %s)" % (pkg_name, binary_t['version'], binary_u['version']))
|
||||||
anyworthdoing = True
|
anyworthdoing = True
|
||||||
|
|
||||||
if not anywrongver and (anyworthdoing or src in self.sources[suite]):
|
if not anywrongver and (anyworthdoing or src in self.sources[suite]):
|
||||||
srcv = self.sources[suite][src]['version']
|
srcv = self.sources[suite][src]['version']
|
||||||
ssrc = self.same_source(source_t['version'], srcv)
|
ssrc = self.same_source(source_t['version'], srcv)
|
||||||
for pkg in set(k.split("/")[0] for k in self.sources['testing'][src]['binaries']):
|
for pkg in sorted([x.split("/")[0] for x in self.sources['testing'][src]['binaries'] if x.endswith("/"+arch)]):
|
||||||
if self.binaries['testing'][arch][0][pkg]['architecture'] == 'all':
|
if self.binaries['testing'][arch][0][pkg]['architecture'] == 'all':
|
||||||
excuse.addhtml("Ignoring removal of %s as it is arch: all" % (pkg))
|
excuse.addhtml("Ignoring removal of %s as it is arch: all" % (pkg))
|
||||||
continue
|
continue
|
||||||
@ -504,7 +504,7 @@ class Britney:
|
|||||||
self.same_source(source_u['version'], self.hints['remove'][src][0]):
|
self.same_source(source_u['version'], self.hints['remove'][src][0]):
|
||||||
excuse.addhtml("Removal request by %s" % (self.hints["remove"][src][1]))
|
excuse.addhtml("Removal request by %s" % (self.hints["remove"][src][1]))
|
||||||
excuse.addhtml("Trying to remove package, not update it")
|
excuse.addhtml("Trying to remove package, not update it")
|
||||||
update_candidate = False
|
update_candidate = False
|
||||||
|
|
||||||
blocked = None
|
blocked = None
|
||||||
if self.hints["block"].has_key(src):
|
if self.hints["block"].has_key(src):
|
||||||
@ -538,9 +538,9 @@ class Britney:
|
|||||||
update_candidate = False
|
update_candidate = False
|
||||||
|
|
||||||
pkgs = {src: ["source"]}
|
pkgs = {src: ["source"]}
|
||||||
for arch in self.options.architectures.split():
|
for arch in self.options.architectures:
|
||||||
oodbins = {}
|
oodbins = {}
|
||||||
for pkg in set(k.split("/")[0] for k in self.sources[suite][src]['binaries']):
|
for pkg in sorted([x.split("/")[0] for x in self.sources[suite][src]['binaries'] if x.endswith("/"+arch)]):
|
||||||
if not pkgs.has_key(pkg): pkgs[pkg] = []
|
if not pkgs.has_key(pkg): pkgs[pkg] = []
|
||||||
pkgs[pkg].append(arch)
|
pkgs[pkg].append(arch)
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ class Britney:
|
|||||||
# Packages to be upgraded from unstable
|
# Packages to be upgraded from unstable
|
||||||
for pkg in self.sources['unstable']:
|
for pkg in self.sources['unstable']:
|
||||||
if self.sources['testing'].has_key(pkg):
|
if self.sources['testing'].has_key(pkg):
|
||||||
for arch in self.options.architectures.split():
|
for arch in self.options.architectures:
|
||||||
if self.should_upgrade_srcarch(pkg, arch, 'unstable'):
|
if self.should_upgrade_srcarch(pkg, arch, 'unstable'):
|
||||||
upgrade_me.append("%s/%s" % (pkg, arch))
|
upgrade_me.append("%s/%s" % (pkg, arch))
|
||||||
|
|
||||||
@ -663,7 +663,7 @@ class Britney:
|
|||||||
# Packages to be upgraded from testing-proposed-updates
|
# Packages to be upgraded from testing-proposed-updates
|
||||||
for pkg in self.sources['tpu']:
|
for pkg in self.sources['tpu']:
|
||||||
if self.sources['testing'].has_key(pkg):
|
if self.sources['testing'].has_key(pkg):
|
||||||
for arch in self.options.architectures.split():
|
for arch in self.options.architectures:
|
||||||
if self.should_upgrade_srcarch(pkg, arch, 'tpu'):
|
if self.should_upgrade_srcarch(pkg, arch, 'tpu'):
|
||||||
upgrade_me.append("%s/%s_tpu" % (pkg, arch))
|
upgrade_me.append("%s/%s_tpu" % (pkg, arch))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user