mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-30 19:11:28 +00:00
merge trunk up to 2013-03-16
This commit is contained in:
commit
c8bfb275ee
49
britney.py
49
britney.py
@ -1344,6 +1344,9 @@ class Britney(object):
|
|||||||
if not anywrongver and (anyworthdoing or not self.sources[suite][src][FAKESRC]):
|
if not anywrongver and (anyworthdoing or not self.sources[suite][src][FAKESRC]):
|
||||||
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)
|
||||||
|
# if this is a binary-only migration via *pu, we never want to try
|
||||||
|
# removing binary packages
|
||||||
|
if not (ssrc and suite != 'unstable'):
|
||||||
# for every binary package produced by this source in testing for this architecture
|
# for every binary package produced by this source in testing for this architecture
|
||||||
for pkg in sorted([x.split("/")[0] for x in self.sources['testing'][src][BINARIES] if x.endswith("/"+arch)]):
|
for pkg in sorted([x.split("/")[0] for x in self.sources['testing'][src][BINARIES] if x.endswith("/"+arch)]):
|
||||||
# if the package is architecture-independent, then ignore it
|
# if the package is architecture-independent, then ignore it
|
||||||
@ -1502,15 +1505,22 @@ class Britney(object):
|
|||||||
if suite in ['pu', 'tpu']:
|
if suite in ['pu', 'tpu']:
|
||||||
# o-o-d(ish) checks for (t-)p-u
|
# o-o-d(ish) checks for (t-)p-u
|
||||||
for arch in self.options.architectures:
|
for arch in self.options.architectures:
|
||||||
# If the package isn't in testing or the testing
|
if src not in self.sources["testing"]:
|
||||||
# package produces no packages on this architecture,
|
continue
|
||||||
# then it can't be out-of-date. We assume that if
|
|
||||||
# the (t-)p-u package has produced any binaries for
|
|
||||||
# this architecture then it is ok
|
|
||||||
|
|
||||||
if not src in self.sources["testing"] or \
|
# if the package in testing has no binaries on this
|
||||||
(len([x for x in self.sources["testing"][src][BINARIES] if x.endswith("/"+arch) and self.binaries["testing"][arch][0][x.split("/")[0]][ARCHITECTURE] != 'all' ]) == 0) or \
|
# architecture, it can't be out-of-date
|
||||||
(len([x for x in self.sources[suite][src][BINARIES] if x.endswith("/"+arch) and self.binaries[suite][arch][0][x.split("/")[0]][ARCHITECTURE] != 'all' ]) > 0):
|
if not any(x for x in self.sources["testing"][src][BINARIES]
|
||||||
|
if x.endswith("/"+arch) and self.binaries["testing"][arch][0][x.split("/")[0]][ARCHITECTURE] != 'all'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# if the (t-)p-u package has produced any binaries on
|
||||||
|
# this architecture then we assume it's ok. this allows for
|
||||||
|
# uploads to (t-)p-u which intentionally drop binary
|
||||||
|
# packages
|
||||||
|
if any(x for x in self.binaries[suite][arch][0].values() \
|
||||||
|
if x[SOURCE] == src and x[SOURCEVER] == source_u[VERSION] and \
|
||||||
|
x[ARCHITECTURE] != 'all'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if suite == 'tpu':
|
if suite == 'tpu':
|
||||||
@ -1724,6 +1734,8 @@ class Britney(object):
|
|||||||
# if a package is going to be removed, it will have a "-" prefix
|
# if a package is going to be removed, it will have a "-" prefix
|
||||||
upgrade_me = []
|
upgrade_me = []
|
||||||
|
|
||||||
|
self.excuses = []
|
||||||
|
|
||||||
# for every source package in testing, check if it should be removed
|
# for every source package in testing, check if it should be removed
|
||||||
for pkg in sources['testing']:
|
for pkg in sources['testing']:
|
||||||
if should_remove_source(pkg):
|
if should_remove_source(pkg):
|
||||||
@ -2063,7 +2075,16 @@ class Britney(object):
|
|||||||
# first, build a list of eligible binaries
|
# first, build a list of eligible binaries
|
||||||
for p in source[BINARIES]:
|
for p in source[BINARIES]:
|
||||||
binary, parch = p.split("/")
|
binary, parch = p.split("/")
|
||||||
if item.architecture != 'source' and parch != item.architecture: continue
|
if item.architecture != 'source':
|
||||||
|
# for a binary migration, binaries should not be removed:
|
||||||
|
# - unless they are for the correct architecture
|
||||||
|
if parch != item.architecture: continue
|
||||||
|
# - if they are arch:all and the migration is via *pu,
|
||||||
|
# as the packages will not have been rebuilt and the
|
||||||
|
# source suite will not contain them
|
||||||
|
if binaries[parch][0][binary][ARCHITECTURE] == 'all' and \
|
||||||
|
item.suite != 'unstable':
|
||||||
|
continue
|
||||||
# do not remove binaries which have been hijacked by other sources
|
# do not remove binaries which have been hijacked by other sources
|
||||||
if binaries[parch][0][binary][SOURCE] != item.package: continue
|
if binaries[parch][0][binary][SOURCE] != item.package: continue
|
||||||
bins.append(p)
|
bins.append(p)
|
||||||
@ -2108,9 +2129,8 @@ class Britney(object):
|
|||||||
# outside of the current source
|
# outside of the current source
|
||||||
for p in check:
|
for p in check:
|
||||||
binary, parch = p.split("/")
|
binary, parch = p.split("/")
|
||||||
rdeps = [ bin for bin in binaries[parch][0][binary][RDEPENDS] \
|
if any(bin for bin in binaries[parch][0][binary][RDEPENDS] \
|
||||||
if bin in [y.split("/")[0] for y in smoothbins] ]
|
if bin in [y.split("/")[0] for y in smoothbins]):
|
||||||
if len(rdeps) > 0:
|
|
||||||
smoothbins.append(p)
|
smoothbins.append(p)
|
||||||
|
|
||||||
# remove all the binaries which aren't being smooth updated
|
# remove all the binaries which aren't being smooth updated
|
||||||
@ -2752,6 +2772,11 @@ class Britney(object):
|
|||||||
# quit the hint tester
|
# quit the hint tester
|
||||||
if input and input[0] in ('quit', 'exit'):
|
if input and input[0] in ('quit', 'exit'):
|
||||||
break
|
break
|
||||||
|
elif input and input[0] in ('remove', 'approve', 'urgent', 'age-days',
|
||||||
|
'block', 'block-udeb', 'unblock', 'unblock-udeb',
|
||||||
|
'block-all', 'force'):
|
||||||
|
self.hints.add_hint(' '.join(input), 'hint-tester')
|
||||||
|
self.write_excuses()
|
||||||
# run a hint
|
# run a hint
|
||||||
elif input and input[0] in ('easy', 'hint', 'force-hint'):
|
elif input and input[0] in ('easy', 'hint', 'force-hint'):
|
||||||
try:
|
try:
|
||||||
|
@ -47,6 +47,7 @@ HINTS_JCRISTAU = STANDARD force force-hint
|
|||||||
HINTS_FAW = HELPERS
|
HINTS_FAW = HELPERS
|
||||||
HINTS_NTHYKIER = STANDARD
|
HINTS_NTHYKIER = STANDARD
|
||||||
HINTS_KIBI = STANDARD
|
HINTS_KIBI = STANDARD
|
||||||
|
HINTS_JMW = STANDARD
|
||||||
HINTS_FREEZE = block block-all block-udeb
|
HINTS_FREEZE = block block-all block-udeb
|
||||||
HINTS_FREEZE-EXCEPTION = unblock unblock-udeb
|
HINTS_FREEZE-EXCEPTION = unblock unblock-udeb
|
||||||
HINTS_SATBRITNEY = easy
|
HINTS_SATBRITNEY = easy
|
||||||
|
28
completer.py
28
completer.py
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (C) 2011 Niels Thykier <niels@thykier.net>
|
# Copyright (C) 2011 Niels Thykier <niels@thykier.net>
|
||||||
|
# Copyright (C) 2013 Adam D. Barratt <adam@adam-barratt.org.uk>
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -28,11 +29,15 @@ class Completer(object):
|
|||||||
Creates a completer for a given britney.
|
Creates a completer for a given britney.
|
||||||
"""
|
"""
|
||||||
self.matches = []
|
self.matches = []
|
||||||
self.cmds = ['easy', 'hint', 'force-hint', 'exit', 'quit']
|
self.cmds = ['easy', 'hint', 'force-hint', 'force', 'remove',
|
||||||
|
'force', 'age-days', 'urgent', 'block-all',
|
||||||
|
'block', 'block-udeb', 'unblock', 'unblock-udeb',
|
||||||
|
'approve', 'exit', 'quit']
|
||||||
self.britney = britney
|
self.britney = britney
|
||||||
# generate a completion list from excuses.
|
# generate a completion list from excuses.
|
||||||
# - it might contain too many items, but meh
|
# - it might contain too many items, but meh
|
||||||
complete = []
|
complete = []
|
||||||
|
tpu = []
|
||||||
for e in britney.excuses:
|
for e in britney.excuses:
|
||||||
ver = None
|
ver = None
|
||||||
pkg = e.name
|
pkg = e.name
|
||||||
@ -40,11 +45,18 @@ class Completer(object):
|
|||||||
if pkg[0] == '-':
|
if pkg[0] == '-':
|
||||||
suite = 'testing'
|
suite = 'testing'
|
||||||
pkg = pkg[1:]
|
pkg = pkg[1:]
|
||||||
|
if "_" in pkg:
|
||||||
|
(pkg, suite) = pkg.split("_")
|
||||||
if "/" in pkg:
|
if "/" in pkg:
|
||||||
pkg = pkg.split("/")[0]
|
pkg = pkg.split("/")[0]
|
||||||
name = "%s/%s" % (e.name, britney.sources[suite][pkg][0]) # 0 == VERSION
|
name = "%s/%s" % (e.name, britney.sources[suite][pkg][0]) # 0 == VERSION
|
||||||
complete.append(name)
|
complete.append(name)
|
||||||
|
if suite == 'tpu':
|
||||||
|
tpu.append(name)
|
||||||
self.packages = sorted(complete)
|
self.packages = sorted(complete)
|
||||||
|
self.tpu_packages = sorted(tpu)
|
||||||
|
testing = britney.sources['testing']
|
||||||
|
self.testing_packages = sorted("%s/%s" % (pkg, testing[pkg][0]) for pkg in testing)
|
||||||
|
|
||||||
def completer(self, text, state):
|
def completer(self, text, state):
|
||||||
"""readline completer (see the readline API)"""
|
"""readline completer (see the readline API)"""
|
||||||
@ -59,11 +71,17 @@ class Completer(object):
|
|||||||
self.matches = [x for x in self.cmds if x.startswith(text)]
|
self.matches = [x for x in self.cmds if x.startswith(text)]
|
||||||
else:
|
else:
|
||||||
# complete pkg/[arch/]version
|
# complete pkg/[arch/]version
|
||||||
start = bisect.bisect_left(self.packages, text)
|
if words[0] == 'remove':
|
||||||
while start < len(self.packages):
|
packages = self.testing_packages
|
||||||
if not self.packages[start].startswith(text):
|
elif words[0] == 'approve':
|
||||||
|
packages = self.tpu_packages
|
||||||
|
else:
|
||||||
|
packages = self.packages
|
||||||
|
start = bisect.bisect_left(packages, text)
|
||||||
|
while start < len(packages):
|
||||||
|
if not packages[start].startswith(text):
|
||||||
break
|
break
|
||||||
self.matches.append(self.packages[start])
|
self.matches.append(packages[start])
|
||||||
start += 1
|
start += 1
|
||||||
|
|
||||||
if len(self.matches) > state:
|
if len(self.matches) > state:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user