Add a --distribution option

pre-rebase-2016-10-25
Colin Watson 11 years ago committed by Martin Pitt
parent 7380e2eb92
commit 3ee64804ed

@ -453,6 +453,8 @@ class Britney(object):
help="just print a summary of uninstallable packages")
parser.add_option("", "--components", action="store", dest="components",
help="Sources/Packages are laid out by components listed (, sep)")
parser.add_option("", "--distribution", action="store", dest="distribution", default="ubuntu",
help="set distribution name")
parser.add_option("", "--series", action="store", dest="series", default=None,
help="set distribution series name")
(self.options, self.args) = parser.parse_args()
@ -1327,6 +1329,7 @@ class Britney(object):
# otherwise, add a new excuse for its removal
src = self.sources['testing'][pkg]
excuse = Excuse("-" + pkg)
excuse.set_distribution(self.options.distribution)
excuse.addhtml("Package not in unstable, will try to remove")
excuse.set_vers(src.version, None)
src.maintainer and excuse.set_maint(src.maintainer)
@ -1365,6 +1368,7 @@ class Britney(object):
excuse.set_vers(source_t.version, source_t.version)
source_u.maintainer and excuse.set_maint(source_u.maintainer)
source_u.section and excuse.set_section(source_u.section)
excuse.set_distribution(self.options.distribution)
# if there is a `remove' hint and the requested version is the same as the
# version in testing, then stop here and return False
@ -1529,6 +1533,7 @@ class Britney(object):
excuse.set_vers(source_t and source_t.version or None, source_u.version)
source_u.maintainer and excuse.set_maint(source_u.maintainer)
source_u.section and excuse.set_section(source_u.section)
excuse.set_distribution(self.options.distribution)
# the starting point is that we will update the candidate
update_candidate = True
@ -1925,6 +1930,7 @@ class Britney(object):
# add the removal of the package to upgrade_me and build a new excuse
upgrade_me_append("-%s" % (src))
excuse = Excuse("-%s" % (src))
excuse.set_distribution(self.options.distribution)
excuse.set_vers(tsrcv, None)
excuse.addhtml("Removal request by %s" % (hint.user))
excuse.addhtml("Package is broken, will try to remove")

@ -53,6 +53,7 @@ class Excuse(object):
self.needs_approval = False
self.hints = []
self.forced = False
self.distribution = "ubuntu"
self.invalid_deps = []
self.deps = {}
@ -106,6 +107,10 @@ class Excuse(object):
"""Set the urgency of upload of the package"""
self.urgency = date
def set_distribution(self, distribution):
"""Set the distribution name"""
self.distribution = distribution
def add_dep(self, name, arch):
"""Add a dependency"""
if name not in self.deps: self.deps[name]=[]

Loading…
Cancel
Save