tree-wide: Remove --ignore-build-no options
This commit is contained in:
+1
-1
@@ -252,7 +252,7 @@ def list_upgradable():
|
||||
Return a list of packages that are upgraded in the repository -> list_of_strings
|
||||
"""
|
||||
installdb = pisi.db.installdb.InstallDB()
|
||||
is_upgradable = lambda pkg: pisi.operations.upgrade.is_upgradable(pkg, ctx.get_option('ignore_build_no'))
|
||||
is_upgradable = pisi.operations.upgrade.is_upgradable
|
||||
|
||||
upgradable = filter(is_upgradable, installdb.list_installed())
|
||||
# replaced packages can not pass is_upgradable test, so we add them manually
|
||||
|
||||
@@ -52,11 +52,6 @@ class Build(command.Command):
|
||||
self.parser.add_option_group(group)
|
||||
|
||||
def add_options(self, group):
|
||||
group.add_option("--ignore-build-no",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=_("Do not take build no into account."))
|
||||
|
||||
group.add_option("-q", "--quiet",
|
||||
action="store_true",
|
||||
default=False,
|
||||
|
||||
+1
-2
@@ -1,6 +1,6 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
|
||||
# Copyright (C) 2005-2010, TUBITAK/UEKAE
|
||||
#
|
||||
# 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 the Free
|
||||
@@ -116,7 +116,6 @@ Lists previous operations.""")
|
||||
|
||||
def run(self):
|
||||
self.init(database = False, write = False)
|
||||
ctx.set_option('ignore_build_no', True)
|
||||
if ctx.get_option('snapshot'):
|
||||
self.take_snapshot()
|
||||
return
|
||||
|
||||
+2
-4
@@ -1,6 +1,6 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
|
||||
# Copyright (C) 2005-2010, TUBITAK/UEKAE
|
||||
#
|
||||
# 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 the Free
|
||||
@@ -44,9 +44,7 @@ expanded to package names.
|
||||
group = optparse.OptionGroup(self.parser, _("install options"))
|
||||
|
||||
super(Install, self).options(group)
|
||||
group.add_option("--ignore-build-no", action="store_true",
|
||||
default=False,
|
||||
help=_("Do not take build no into account."))
|
||||
|
||||
group.add_option("--reinstall", action="store_true",
|
||||
default=False, help=_("Reinstall already installed packages"))
|
||||
group.add_option("--ignore-check", action="store_true",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
|
||||
# Copyright (C) 2005-2010, TUBITAK/UEKAE
|
||||
#
|
||||
# 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 the Free
|
||||
@@ -40,9 +40,6 @@ Lists the packages that will be upgraded.
|
||||
|
||||
def options(self):
|
||||
group = optparse.OptionGroup(self.parser, _("list-upgrades options"))
|
||||
group.add_option("--ignore-build-no", action="store_true",
|
||||
default=False,
|
||||
help=_("Do not take build no into account."))
|
||||
group.add_option("-l", "--long", action="store_true",
|
||||
default=False, help=_("Show in long format"))
|
||||
group.add_option("-c", "--component", action="store",
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
|
||||
# Copyright (C) 2005-2010, TUBITAK/UEKAE
|
||||
#
|
||||
# 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 the Free
|
||||
@@ -50,9 +50,6 @@ expanded to package names.
|
||||
group = optparse.OptionGroup(self.parser, _("upgrade options"))
|
||||
|
||||
super(Upgrade, self).options(group)
|
||||
group.add_option("--ignore-build-no", action="store_true",
|
||||
default=False,
|
||||
help=_("Do not take build no into account."))
|
||||
group.add_option("--security-only", action="store_true",
|
||||
default=False, help=_("Security related package upgrades only"))
|
||||
group.add_option("-b", "--bypass-update-repo", action="store_true",
|
||||
|
||||
@@ -68,7 +68,6 @@ def find_upgrades(packages, replaces):
|
||||
installdb = pisi.db.installdb.InstallDB()
|
||||
|
||||
security_only = ctx.get_option('security_only')
|
||||
ignore_build = ctx.get_option('ignore_build_no')
|
||||
|
||||
Ap = []
|
||||
for i_pkg in packages:
|
||||
@@ -99,18 +98,12 @@ def find_upgrades(packages, replaces):
|
||||
pisi.version.make_version(pkg.distributionRelease) > pisi.version.make_version(distro_release):
|
||||
Ap.append(i_pkg)
|
||||
|
||||
elif ignore_build or (not build) or (not pkg.build):
|
||||
else:
|
||||
if int(release) < int(pkg.release):
|
||||
Ap.append(i_pkg)
|
||||
else:
|
||||
ctx.ui.info(_('Package %s is already at the latest release %s.')
|
||||
% (pkg.name, pkg.release), True)
|
||||
else:
|
||||
if build < pkg.build:
|
||||
Ap.append(i_pkg)
|
||||
else:
|
||||
ctx.ui.info(_('Package %s is already at the latest build %s.')
|
||||
% (pkg.name, pkg.build), True)
|
||||
|
||||
return Ap
|
||||
|
||||
@@ -349,7 +342,6 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
|
||||
def upgrade_base(A = set()):
|
||||
installdb = pisi.db.installdb.InstallDB()
|
||||
componentdb = pisi.db.componentdb.ComponentDB()
|
||||
ignore_build = ctx.get_option('ignore_build_no')
|
||||
if not ctx.config.values.general.ignore_safety and not ctx.get_option('ignore_safety'):
|
||||
if componentdb.has_component('system.base'):
|
||||
systembase = set(componentdb.get_union_component('system.base').packages)
|
||||
@@ -360,7 +352,7 @@ def upgrade_base(A = set()):
|
||||
"following packages:"))
|
||||
ctx.ui.info(util.format_by_columns(sorted(extra_installs)))
|
||||
G_f, install_order = operations.install.plan_install_pkg_names(extra_installs)
|
||||
extra_upgrades = filter(lambda x: is_upgradable(x, ignore_build), systembase - set(install_order))
|
||||
extra_upgrades = filter(lambda x: is_upgradable(x), systembase - set(install_order))
|
||||
upgrade_order = []
|
||||
|
||||
extra_upgrades = pisi.blacklist.exclude_from(extra_upgrades, ctx.const.blacklist)
|
||||
@@ -382,7 +374,7 @@ def upgrade_base(A = set()):
|
||||
ctx.ui.warning(_('Safety switch: The component system.base cannot be found.'))
|
||||
return set()
|
||||
|
||||
def is_upgradable(name, ignore_build = False):
|
||||
def is_upgradable(name):
|
||||
|
||||
installdb = pisi.db.installdb.InstallDB()
|
||||
|
||||
@@ -403,7 +395,5 @@ def is_upgradable(name, ignore_build = False):
|
||||
if distro == i_distro and \
|
||||
pisi.version.make_version(distro_release) > pisi.version.make_version(i_distro_release):
|
||||
return True
|
||||
elif ignore_build or (not i_build) or (not build):
|
||||
return int(i_release) < int(release)
|
||||
else:
|
||||
return i_build < build
|
||||
|
||||
return int(i_release) < int(release)
|
||||
|
||||
@@ -7,7 +7,6 @@ class TestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
options = pisi.config.Options()
|
||||
options.ignore_build_no = False
|
||||
options.destdir = 'repos/tmp'
|
||||
pisi.api.set_options(options)
|
||||
pisi.api.set_comar(False)
|
||||
|
||||
@@ -51,7 +51,6 @@ from versiontest import VersionTestCase
|
||||
|
||||
def setup():
|
||||
options = pisi.config.Options()
|
||||
options.ignore_build_no = False
|
||||
options.destdir = 'repos/tmp'
|
||||
pisi.api.set_options(options)
|
||||
pisi.api.set_comar(False)
|
||||
|
||||
Reference in New Issue
Block a user