From 65c30ff7d51224dd589ee426d79973d2c2f6bc35 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Jan 2006 10:46:15 +0100 Subject: * fixes in the changes calculation code --- DistUpgrade/DistUpgradeControler.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 9888bf85..55040c55 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -73,8 +73,7 @@ class MyCache(apt.Cache): """ create a snapshot of the current changes """ self.to_install = [] self.to_remove = [] - for name in self.getChanges(): - pkg = self[name] + for pkg in self.getChanges(): if pkg.markedInstall or pkg.markedUpgrade: self.to_install.append(name) if pkg.markedDelete: @@ -396,9 +395,9 @@ class DistUpgradeControler(object): # that are not obsolete as well self.cache.create_snapshot() self.cache[pkgname].markDelete() - for change in self.cache.getChanges(): - if change not in remove_candidates or \ - change in self.foreign_pkgs: + for pkg in self.cache.getChanges(): + if pkg.name not in remove_candidates or \ + pkg.name in self.foreign_pkgs: self.cache.restore_snapshot() if self._view.confirmChanges(_("Remove obsolete Packages?"), self.cache.getChanges(), 0): -- cgit v1.2.3