mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 14:07:29 +00:00
Add a --distribution option
This commit is contained in:
parent
f4dc6b2277
commit
964e414dbe
@ -417,6 +417,8 @@ class Britney(object):
|
||||
help="Do not compute which packages can migrate.")
|
||||
parser.add_option("", "--series", action="store", dest="series", default='',
|
||||
help="set distribution series name")
|
||||
parser.add_option("", "--distribution", action="store", dest="distribution", default="Debian",
|
||||
help="set distribution name")
|
||||
(self.options, self.args) = parser.parse_args()
|
||||
|
||||
if self.options.verbose:
|
||||
|
@ -236,6 +236,10 @@ class Excuse(object):
|
||||
"""Set the section of the package"""
|
||||
self.section = section
|
||||
|
||||
def set_distribution(self, distribution):
|
||||
"""Set the distribution name"""
|
||||
self.distribution = distribution
|
||||
|
||||
def add_dependency(self, dep, spec):
|
||||
"""Add a dependency of type deptype
|
||||
|
||||
|
@ -49,6 +49,7 @@ class ExcuseFinder(object):
|
||||
# otherwise, add a new excuse for its removal
|
||||
src = item.suite.sources[pkg]
|
||||
excuse = Excuse(item)
|
||||
excuse.set_distribution(self.options.distribution)
|
||||
excuse.addinfo("Package not in %s, will try to remove" % source_suite.name)
|
||||
excuse.set_vers(src.version, None)
|
||||
src.maintainer and excuse.set_maint(src.maintainer)
|
||||
@ -93,6 +94,7 @@ class ExcuseFinder(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
|
||||
@ -294,6 +296,7 @@ class ExcuseFinder(object):
|
||||
source_u.maintainer and excuse.set_maint(source_u.maintainer)
|
||||
source_u.section and excuse.set_section(source_u.section)
|
||||
excuse.add_package(PackageId(src, source_u.version, "source"))
|
||||
excuse.set_distribution(self.options.distribution)
|
||||
|
||||
# if the version in unstable is older, then stop here with a warning in the excuse and return False
|
||||
if source_t and apt_pkg.version_compare(source_u.version, source_t.version) < 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user