From 636b6a1241f1317f95d0f9a9de87355f4c81b0c6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Oct 2006 12:09:32 +0200 Subject: * UpdateManager/UpdateManager.py: - only show the dist-upgrade dialog if anything would have to be delted --- UpdateManager/UpdateManager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'UpdateManager') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 1a4c7c40..ab1d8a95 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -114,10 +114,12 @@ class MyCache(apt.Cache): def saveDistUpgrade(self): """ this functions mimics a upgrade but will never remove anything """ self._depcache.Upgrade(True) + wouldDelete = self._depcache.DelCount if self._depcache.DelCount > 0: self.clear() assert self._depcache.BrokenCount == 0 and self._depcache.DelCount == 0 self._depcache.Upgrade() + return wouldDelete def get_changelog(self, name, lock): # don't touch the gui in this function, it needs to be thread-safe @@ -250,7 +252,7 @@ class UpdateList: self.held_back = [] # do the upgrade - cache.saveDistUpgrade() + self.distUpgradeWouldDelete = cache.saveDistUpgrade() # sort by origin for pkg in cache: @@ -911,7 +913,7 @@ class UpdateManager(SimpleGladeApp): def check_all_updates_installable(self): """ Check if all available updates can be installed and suggest to run a distribution upgrade if not """ - if self.list.keepcount > 0: + if self.list.distUpgradeWouldDelete > 0: self.dialog_dist_upgrade.set_transient_for(self.window_main) res = self.dialog_dist_upgrade.run() self.dialog_dist_upgrade.hide() -- cgit v1.2.3