From 860844cf8d6081698ae3b6d6cf76a5616d1d7f83 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 5 Nov 2008 09:30:21 +0000 Subject: [PATCH] replaced packages are also obsoleted packages, they will already be removed in remove_obsoleted_packages --- pisi/operations/remove.py | 16 ---------------- pisi/operations/upgrade.py | 5 +---- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pisi/operations/remove.py b/pisi/operations/remove.py index 616ec4f5..021e4fe4 100644 --- a/pisi/operations/remove.py +++ b/pisi/operations/remove.py @@ -114,27 +114,11 @@ def plan_remove(A): order = G_f.topological_sort() return G_f, order -# FIXME: this should be done in atomicoperations automatically. -def remove_replaced_packages(order, replaces): - - replaced = [] - inorder = set(order).intersection(replaces.values()) - - if inorder: - for pkg in replaces.keys(): - if replaces[pkg] in inorder: - replaced.append(pkg) - - if replaced: - if remove(replaced, ignore_dep=True, ignore_safety=True): - raise Exception(_("Replaced package remains")) - def remove_conflicting_packages(conflicts): if remove(conflicts, ignore_dep=True, ignore_safety=True): raise Exception(_("Conflicts remain")) def remove_obsoleted_packages(): - installdb = pisi.db.installdb.InstallDB() packagedb = pisi.db.packagedb.PackageDB() obsoletes = filter(installdb.has_package, packagedb.get_obsoletes()) diff --git a/pisi/operations/upgrade.py b/pisi/operations/upgrade.py index 1f268b7c..2c70c505 100644 --- a/pisi/operations/upgrade.py +++ b/pisi/operations/upgrade.py @@ -147,11 +147,8 @@ def upgrade_pkg_names(A = []): if conflicts: operations.remove.remove_conflicting_packages(conflicts) - if replaces: - operations.remove.remove_replaced_packages(order, replaces) - operations.remove.remove_obsoleted_packages() - + for path in paths: ctx.ui.info(util.colorize(_("Installing %d / %d") % (paths.index(path)+1, len(paths)), "yellow")) install_op = atomicoperations.Install(path, ignore_file_conflicts = True)