summaryrefslogtreecommitdiff
path: root/UpdateManager
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-10-04 12:09:32 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-10-04 12:09:32 +0200
commit636b6a1241f1317f95d0f9a9de87355f4c81b0c6 (patch)
treea305245b40771e4e50a6a47316eca9d586627e80 /UpdateManager
parent34083e823a767755aa55a202f037d83e085fc3d5 (diff)
downloadpython-apt-636b6a1241f1317f95d0f9a9de87355f4c81b0c6.tar.gz
* UpdateManager/UpdateManager.py:
- only show the dist-upgrade dialog if anything would have to be delted
Diffstat (limited to 'UpdateManager')
-rw-r--r--UpdateManager/UpdateManager.py6
1 files changed, 4 insertions, 2 deletions
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()