diff --git a/pisi/api.py b/pisi/api.py index 745a940b..278b2ca9 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -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 diff --git a/pisi/cli/build.py b/pisi/cli/build.py index 383b9b66..b553f0a4 100644 --- a/pisi/cli/build.py +++ b/pisi/cli/build.py @@ -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, diff --git a/pisi/cli/history.py b/pisi/cli/history.py index eea314b9..f0ad1c25 100644 --- a/pisi/cli/history.py +++ b/pisi/cli/history.py @@ -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 diff --git a/pisi/cli/install.py b/pisi/cli/install.py index 132c898f..7b755ec2 100644 --- a/pisi/cli/install.py +++ b/pisi/cli/install.py @@ -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", diff --git a/pisi/cli/listupgrades.py b/pisi/cli/listupgrades.py index 533a2109..39f815f3 100644 --- a/pisi/cli/listupgrades.py +++ b/pisi/cli/listupgrades.py @@ -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", diff --git a/pisi/cli/upgrade.py b/pisi/cli/upgrade.py index 4c2944a7..e88b0a74 100644 --- a/pisi/cli/upgrade.py +++ b/pisi/cli/upgrade.py @@ -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", diff --git a/pisi/operations/upgrade.py b/pisi/operations/upgrade.py index 5c9d5568..5c165411 100644 --- a/pisi/operations/upgrade.py +++ b/pisi/operations/upgrade.py @@ -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) diff --git a/tests/database/testcase.py b/tests/database/testcase.py index cca50c0c..0177e0fd 100644 --- a/tests/database/testcase.py +++ b/tests/database/testcase.py @@ -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) diff --git a/tests/runtests.py b/tests/runtests.py index 7ebed282..ec860b0b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -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)