mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-18 05:01:35 +00:00
Support for single-architecture updates.
This commit is contained in:
parent
db59ded380
commit
e3b6b42181
65
britney.py
65
britney.py
@ -1287,13 +1287,13 @@ class Britney:
|
|||||||
|
|
||||||
return nuninst
|
return nuninst
|
||||||
|
|
||||||
def eval_nuninst(self, nuninst):
|
def eval_nuninst(self, nuninst, original=None):
|
||||||
res = []
|
res = []
|
||||||
total = 0
|
total = 0
|
||||||
totalbreak = 0
|
totalbreak = 0
|
||||||
for arch in self.options.architectures:
|
for arch in self.options.architectures:
|
||||||
if nuninst.has_key(arch):
|
if nuninst.has_key(arch):
|
||||||
n = len(nuninst[arch])
|
n = len(nuninst[arch]) + (original and len(original[arch]) or 0)
|
||||||
if arch in self.options.break_arches:
|
if arch in self.options.break_arches:
|
||||||
totalbreak = totalbreak + n
|
totalbreak = totalbreak + n
|
||||||
else:
|
else:
|
||||||
@ -1314,26 +1314,27 @@ class Britney:
|
|||||||
undo = {'binaries': {}, 'sources': {}}
|
undo = {'binaries': {}, 'sources': {}}
|
||||||
|
|
||||||
affected = []
|
affected = []
|
||||||
|
arch = None
|
||||||
|
|
||||||
# arch = "<source>/<arch>",
|
# arch = "<source>/<arch>",
|
||||||
if "/" in pkg:
|
if "/" in pkg:
|
||||||
print "NOT HANDLED!"
|
pkg_name, arch = pkg.split("/")
|
||||||
sys.exit(1)
|
suite = "unstable"
|
||||||
|
|
||||||
# removals = "-<source>",
|
# removals = "-<source>",
|
||||||
|
elif pkg[0] == "-":
|
||||||
|
pkg_name = pkg[1:]
|
||||||
|
suite = "testing"
|
||||||
|
# testing-proposed-updates = "<source>_tpu"
|
||||||
|
elif pkg[0].endswith("_tpu"):
|
||||||
|
pkg_name = pkg[:-4]
|
||||||
|
suite = "tpu"
|
||||||
# normal = "<source>"
|
# normal = "<source>"
|
||||||
else:
|
else:
|
||||||
if pkg[0] == "-":
|
pkg_name = pkg
|
||||||
pkg_name = pkg[1:]
|
suite = "unstable"
|
||||||
suite = "testing"
|
|
||||||
elif pkg[0].endswith("_tpu"):
|
|
||||||
pkg_name = pkg[:-4]
|
|
||||||
suite = "tpu"
|
|
||||||
else:
|
|
||||||
pkg_name = pkg
|
|
||||||
suite = "unstable"
|
|
||||||
|
|
||||||
# remove all binary packages (if the source already exists)
|
# remove all binary packages (if the source already exists)
|
||||||
|
if not arch:
|
||||||
if pkg_name in self.sources['testing']:
|
if pkg_name in self.sources['testing']:
|
||||||
source = self.sources['testing'][pkg_name]
|
source = self.sources['testing'][pkg_name]
|
||||||
for p in source['binaries']:
|
for p in source['binaries']:
|
||||||
@ -1344,20 +1345,26 @@ class Britney:
|
|||||||
del self.binaries['testing'][arch][0][binary]
|
del self.binaries['testing'][arch][0][binary]
|
||||||
undo['sources'][pkg_name] = source
|
undo['sources'][pkg_name] = source
|
||||||
del self.sources['testing'][pkg_name]
|
del self.sources['testing'][pkg_name]
|
||||||
|
# single architecture update (eg. binNMU)
|
||||||
|
else:
|
||||||
|
if self.binaries['testing'][arch][0].has_key(pkg_name):
|
||||||
|
for j in self.binaries['testing'][arch][0][pkg_name]['rdepends']:
|
||||||
|
if j not in affected: affected.append((j[0], j[1], j[2], arch))
|
||||||
|
source = {'binaries': [pkg]}
|
||||||
|
|
||||||
# add the new binary packages (if we are not removing)
|
# add the new binary packages (if we are not removing)
|
||||||
if pkg[0] != "-":
|
if pkg[0] != "-":
|
||||||
source = self.sources[suite][pkg_name]
|
source = self.sources[suite][pkg_name]
|
||||||
for p in source['binaries']:
|
for p in source['binaries']:
|
||||||
binary, arch = p.split("/")
|
binary, arch = p.split("/")
|
||||||
if p not in affected:
|
if p not in affected:
|
||||||
affected.append((binary, None, None, arch))
|
affected.append((binary, None, None, arch))
|
||||||
if binary in self.binaries['testing'][arch][0]:
|
if binary in self.binaries['testing'][arch][0]:
|
||||||
undo['binaries'][p] = self.binaries['testing'][arch][0][binary]
|
undo['binaries'][p] = self.binaries['testing'][arch][0][binary]
|
||||||
self.binaries['testing'][arch][0][binary] = self.binaries[suite][arch][0][binary]
|
self.binaries['testing'][arch][0][binary] = self.binaries[suite][arch][0][binary]
|
||||||
for j in self.binaries['testing'][arch][0][binary]['rdepends']:
|
for j in self.binaries['testing'][arch][0][binary]['rdepends']:
|
||||||
if j not in affected: affected.append((j[0], j[1], j[2], arch))
|
if j not in affected: affected.append((j[0], j[1], j[2], arch))
|
||||||
self.sources['testing'][pkg_name] = self.sources[suite][pkg_name]
|
self.sources['testing'][pkg_name] = self.sources[suite][pkg_name]
|
||||||
|
|
||||||
return (pkg_name, suite, affected, undo)
|
return (pkg_name, suite, affected, undo)
|
||||||
|
|
||||||
@ -1420,7 +1427,7 @@ class Britney:
|
|||||||
nuninst_comp = nuninst_new
|
nuninst_comp = nuninst_new
|
||||||
else:
|
else:
|
||||||
output.write("skipped: %s (%d <- %d)\n" % (pkg, len(extra), len(packages)))
|
output.write("skipped: %s (%d <- %d)\n" % (pkg, len(extra), len(packages)))
|
||||||
output.write(" got: %s\n" % self.eval_nuninst(nuninst))
|
output.write(" got: %s\n" % self.eval_nuninst(nuninst, self.nuninst_orig))
|
||||||
output.write(" * %s: %s\n" % (arch, ", ".join(nuninst[arch])))
|
output.write(" * %s: %s\n" % (arch, ", ".join(nuninst[arch])))
|
||||||
extra.append(pkg)
|
extra.append(pkg)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user