mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-16 13:01:29 +00:00
Add a --distribution option; parameterise most mentions of "ubuntu" using it.
This commit is contained in:
parent
f7b4cbc5cb
commit
0a2b1fd4b0
@ -47,8 +47,9 @@ class AutoPackageTest(object):
|
|||||||
accepted.
|
accepted.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, britney, series, debug=False):
|
def __init__(self, britney, distribution, series, debug=False):
|
||||||
self.britney = britney
|
self.britney = britney
|
||||||
|
self.distribution = distribution
|
||||||
self.series = series
|
self.series = series
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
self.read()
|
self.read()
|
||||||
@ -64,11 +65,12 @@ class AutoPackageTest(object):
|
|||||||
print(dedent("""\
|
print(dedent("""\
|
||||||
release: %s
|
release: %s
|
||||||
aptroot: ~/.chdist/%s-proposed-amd64/
|
aptroot: ~/.chdist/%s-proposed-amd64/
|
||||||
apturi: file:%s/mirror/ubuntu
|
apturi: file:%s/mirror/%s
|
||||||
components: main restricted universe multiverse
|
components: main restricted universe multiverse
|
||||||
rsync_host: rsync://tachash.ubuntu-ci/adt/
|
rsync_host: rsync://tachash.ubuntu-ci/adt/
|
||||||
datadir: ~/proposed-migration/autopkgtest/data""" %
|
datadir: ~/proposed-migration/autopkgtest/data""" %
|
||||||
(self.series, self.series, home)), file=rc_file)
|
(self.series, self.series, home, self.distribution)),
|
||||||
|
file=rc_file)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _request_path(self):
|
def _request_path(self):
|
||||||
|
19
britney.py
19
britney.py
@ -371,6 +371,8 @@ class Britney(object):
|
|||||||
help="do not build the non-installability status, use the cache from file")
|
help="do not build the non-installability status, use the cache from file")
|
||||||
parser.add_option("", "--print-uninst", action="store_true", dest="print_uninst", default=False,
|
parser.add_option("", "--print-uninst", action="store_true", dest="print_uninst", default=False,
|
||||||
help="just print a summary of uninstallable packages")
|
help="just print a summary of uninstallable packages")
|
||||||
|
parser.add_option("", "--distribution", action="store", dest="distribution", default="ubuntu",
|
||||||
|
help="set distribution name")
|
||||||
parser.add_option("", "--series", action="store", dest="series", default=None,
|
parser.add_option("", "--series", action="store", dest="series", default=None,
|
||||||
help="set distribution series name")
|
help="set distribution series name")
|
||||||
(self.options, self.args) = parser.parse_args()
|
(self.options, self.args) = parser.parse_args()
|
||||||
@ -1136,6 +1138,7 @@ class Britney(object):
|
|||||||
# otherwise, add a new excuse for its removal and return True
|
# otherwise, add a new excuse for its removal and return True
|
||||||
src = self.sources['testing'][pkg]
|
src = self.sources['testing'][pkg]
|
||||||
excuse = Excuse("-" + pkg)
|
excuse = Excuse("-" + pkg)
|
||||||
|
excuse.set_distribution(self.options.distribution)
|
||||||
excuse.set_vers(src[VERSION], None)
|
excuse.set_vers(src[VERSION], None)
|
||||||
src[MAINTAINER] and excuse.set_maint(src[MAINTAINER].strip())
|
src[MAINTAINER] and excuse.set_maint(src[MAINTAINER].strip())
|
||||||
src[SECTION] and excuse.set_section(src[SECTION].strip())
|
src[SECTION] and excuse.set_section(src[SECTION].strip())
|
||||||
@ -1172,6 +1175,7 @@ class Britney(object):
|
|||||||
# build the common part of the excuse, which will be filled by the code below
|
# build the common part of the excuse, which will be filled by the code below
|
||||||
ref = "%s/%s%s" % (src, arch, suite != 'unstable' and "_" + suite or "")
|
ref = "%s/%s%s" % (src, arch, suite != 'unstable' and "_" + suite or "")
|
||||||
excuse = Excuse(ref)
|
excuse = Excuse(ref)
|
||||||
|
excuse.set_distribution(self.options.distribution)
|
||||||
excuse.set_vers(source_t[VERSION], source_t[VERSION])
|
excuse.set_vers(source_t[VERSION], source_t[VERSION])
|
||||||
source_u[MAINTAINER] and excuse.set_maint(source_u[MAINTAINER].strip())
|
source_u[MAINTAINER] and excuse.set_maint(source_u[MAINTAINER].strip())
|
||||||
source_u[SECTION] and excuse.set_section(source_u[SECTION].strip())
|
source_u[SECTION] and excuse.set_section(source_u[SECTION].strip())
|
||||||
@ -1327,6 +1331,7 @@ class Britney(object):
|
|||||||
# build the common part of the excuse, which will be filled by the code below
|
# build the common part of the excuse, which will be filled by the code below
|
||||||
ref = "%s%s" % (src, suite != 'unstable' and "_" + suite or "")
|
ref = "%s%s" % (src, suite != 'unstable' and "_" + suite or "")
|
||||||
excuse = Excuse(ref)
|
excuse = Excuse(ref)
|
||||||
|
excuse.set_distribution(self.options.distribution)
|
||||||
excuse.set_vers(source_t and source_t[VERSION] or None, source_u[VERSION])
|
excuse.set_vers(source_t and source_t[VERSION] or None, source_u[VERSION])
|
||||||
source_u[MAINTAINER] and excuse.set_maint(source_u[MAINTAINER].strip())
|
source_u[MAINTAINER] and excuse.set_maint(source_u[MAINTAINER].strip())
|
||||||
source_u[SECTION] and excuse.set_section(source_u[SECTION].strip())
|
source_u[SECTION] and excuse.set_section(source_u[SECTION].strip())
|
||||||
@ -1463,7 +1468,7 @@ class Britney(object):
|
|||||||
base = 'testing'
|
base = 'testing'
|
||||||
else:
|
else:
|
||||||
base = 'stable'
|
base = 'stable'
|
||||||
text = "Not yet built on <a href=\"https://launchpad.net/ubuntu/+source/%s/%s\" target=\"_blank\">%s</a> (relative to testing)" % (urllib.quote(src.split("/")[0]), urllib.quote(source_u[VERSION]), arch)
|
text = "Not yet built on <a href=\"https://launchpad.net/%s/+source/%s/%s\" target=\"_blank\">%s</a> (relative to testing)" % (self.options.distribution, urllib.quote(src.split("/")[0]), urllib.quote(source_u[VERSION]), arch)
|
||||||
|
|
||||||
if arch in self.options.outofsync_arches.split():
|
if arch in self.options.outofsync_arches.split():
|
||||||
text = text + " (but %s isn't keeping up, so never mind)" % (arch)
|
text = text + " (but %s isn't keeping up, so never mind)" % (arch)
|
||||||
@ -1522,12 +1527,12 @@ class Britney(object):
|
|||||||
if maxver is not None and apt_pkg.version_compare(maxver, v) > 0:
|
if maxver is not None and apt_pkg.version_compare(maxver, v) > 0:
|
||||||
maybe_nbs = "; NBS?"
|
maybe_nbs = "; NBS?"
|
||||||
break
|
break
|
||||||
oodtxt = oodtxt + "%s (from <a href=\"https://launchpad.net/ubuntu/+source/" \
|
oodtxt = oodtxt + "%s (from <a href=\"https://launchpad.net/%s/+source/" \
|
||||||
"%s/%s\" target=\"_blank\">%s</a>%s)" % \
|
"%s/%s\" target=\"_blank\">%s</a>%s)" % \
|
||||||
(", ".join(sorted(oodbins[v])), urllib.quote(src.split("/")[0]), urllib.quote(v), v, maybe_nbs)
|
(self.options.distribution, ", ".join(sorted(oodbins[v])), urllib.quote(src.split("/")[0]), urllib.quote(v), v, maybe_nbs)
|
||||||
text = "out of date on <a href=\"https://launchpad.net/ubuntu/+source/" \
|
text = "out of date on <a href=\"https://launchpad.net/%s/+source/" \
|
||||||
"%s/%s\" target=\"_blank\">%s</a>: %s" % \
|
"%s/%s\" target=\"_blank\">%s</a>: %s" % \
|
||||||
(urllib.quote(src.split("/")[0]), urllib.quote(source_u[VERSION]), arch, oodtxt)
|
(self.options.distribution, urllib.quote(src.split("/")[0]), urllib.quote(source_u[VERSION]), arch, oodtxt)
|
||||||
|
|
||||||
if arch in self.options.outofsync_arches.split():
|
if arch in self.options.outofsync_arches.split():
|
||||||
text = text + " (but %s isn't keeping up, so nevermind)" % (arch)
|
text = text + " (but %s isn't keeping up, so nevermind)" % (arch)
|
||||||
@ -1733,6 +1738,7 @@ class Britney(object):
|
|||||||
# add the removal of the package to upgrade_me and build a new excuse
|
# add the removal of the package to upgrade_me and build a new excuse
|
||||||
upgrade_me.append("-%s" % (src))
|
upgrade_me.append("-%s" % (src))
|
||||||
excuse = Excuse("-%s" % (src))
|
excuse = Excuse("-%s" % (src))
|
||||||
|
excuse.set_distribution(self.options.distribution)
|
||||||
excuse.set_vers(tsrcv, None)
|
excuse.set_vers(tsrcv, None)
|
||||||
excuse.addhtml("Removal request by %s" % (item.user))
|
excuse.addhtml("Removal request by %s" % (item.user))
|
||||||
excuse.addhtml("Package is broken, will try to remove")
|
excuse.addhtml("Package is broken, will try to remove")
|
||||||
@ -1749,7 +1755,8 @@ class Britney(object):
|
|||||||
# trigger autopkgtests for valid candidates
|
# trigger autopkgtests for valid candidates
|
||||||
adt_debug = getattr(self.options, "adt_debug", "no") == "yes"
|
adt_debug = getattr(self.options, "adt_debug", "no") == "yes"
|
||||||
autopkgtest = AutoPackageTest(
|
autopkgtest = AutoPackageTest(
|
||||||
self, self.options.series, debug=adt_debug)
|
self, self.options.distribution, self.options.series,
|
||||||
|
debug=adt_debug)
|
||||||
autopkgtest_packages = []
|
autopkgtest_packages = []
|
||||||
autopkgtest_excuses = []
|
autopkgtest_excuses = []
|
||||||
autopkgtest_excludes = []
|
autopkgtest_excludes = []
|
||||||
|
@ -51,6 +51,7 @@ class Excuse(object):
|
|||||||
self._is_valid = False
|
self._is_valid = False
|
||||||
self._dontinvalidate = False
|
self._dontinvalidate = False
|
||||||
self.run_autopkgtest = False
|
self.run_autopkgtest = False
|
||||||
|
self.distribution = "ubuntu"
|
||||||
|
|
||||||
self.invalid_deps = []
|
self.invalid_deps = []
|
||||||
self.deps = {}
|
self.deps = {}
|
||||||
@ -92,6 +93,10 @@ class Excuse(object):
|
|||||||
"""Set the urgency of upload of the package"""
|
"""Set the urgency of upload of the package"""
|
||||||
self.urgency = date
|
self.urgency = date
|
||||||
|
|
||||||
|
def set_distribution(self, distribution):
|
||||||
|
"""Set the distribution name"""
|
||||||
|
self.distribution = distribution
|
||||||
|
|
||||||
def add_dep(self, name, arch):
|
def add_dep(self, name, arch):
|
||||||
"""Add a dependency"""
|
"""Add a dependency"""
|
||||||
if name not in self.deps: self.deps[name]=[]
|
if name not in self.deps: self.deps[name]=[]
|
||||||
@ -121,7 +126,7 @@ class Excuse(object):
|
|||||||
|
|
||||||
def html(self):
|
def html(self):
|
||||||
"""Render the excuse in HTML"""
|
"""Render the excuse in HTML"""
|
||||||
lp_pkg = "https://launchpad.net/ubuntu/+source/%s" % self.name.split("/")[0]
|
lp_pkg = "https://launchpad.net/%s/+source/%s" % (self.distribution, self.name.split("/")[0])
|
||||||
if self.ver[0] == "-":
|
if self.ver[0] == "-":
|
||||||
lp_old = self.ver[0]
|
lp_old = self.ver[0]
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user