summaryrefslogtreecommitdiff
path: root/UpdateManager
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-06-28 10:19:54 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-06-28 10:19:54 +0200
commit8da0ea4e985d947ff176d2f5e5eada1f1d255a1e (patch)
treeac7ed79bed4935267b86d8d4ba28452f66ba0617 /UpdateManager
parent4fb02d6b79ae8d284af0dfa0a70ac9436e491e31 (diff)
downloadpython-apt-8da0ea4e985d947ff176d2f5e5eada1f1d255a1e.tar.gz
* speedups in the MyCache.clear() code
* minor code cleanups (move the depcache code into _initDepCcche())
Diffstat (limited to 'UpdateManager')
-rw-r--r--UpdateManager/UpdateManager.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index d4cc7a59..109e4d0c 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -83,11 +83,19 @@ CHANGELOGS_URI="http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/chan
class MyCache(apt.Cache):
def __init__(self, progress):
apt.Cache.__init__(self, progress)
+ self._initDepCache()
assert self._depcache.BrokenCount == 0 and self._depcache.DelCount == 0
self.all_changes = {}
+ def _initDepCache(self):
+ #apt_pkg.Config.Set("Debug::pkgPolicy","1")
+ #self.depcache = apt_pkg.GetDepCache(self.cache)
+ #self._depcache = apt_pkg.GetDepCache(self._cache)
+ self._depcache.ReadPinFile()
+ if os.path.exists(SYNAPTIC_PINFILE):
+ self._depcache.ReadPinFile(SYNAPTIC_PINFILE)
+ self._depcache.Init()
def clean(self):
- for pkg in self:
- pkg.markKeep()
+ self._initDepCache()
def saveDistUpgrade(self):
""" this functions mimics a upgrade but will never remove anything """
self._depcache.Upgrade(True)
@@ -755,13 +763,6 @@ class UpdateManager(SimpleGladeApp):
sys.exit(1)
else:
progress.hide()
- #apt_pkg.Config.Set("Debug::pkgPolicy","1")
- #self.depcache = apt_pkg.GetDepCache(self.cache)
- self.cache._depcache.ReadPinFile()
- if os.path.exists(SYNAPTIC_PINFILE):
- self.cache._depcache.ReadPinFile(SYNAPTIC_PINFILE)
- self.cache._depcache.Init()
-
def check_auto_update(self):
# Check if automatic update is enabled. If not show a dialog to inform