summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
Diffstat (limited to 'apt')
-rw-r--r--apt/cache.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 920a3023..be137b76 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -66,7 +66,11 @@ class Cache(object):
self._weakref = weakref.WeakValueDictionary()
self._set = set()
self._fullnameset = set()
+ self._changes_count = -1
self._sorted_set = None
+
+ self.connect("cache_post_open", self._inc_changes_count)
+ self.connect("cache_post_change", self._inc_changes_count)
if memonly:
# force apt to build its caches in memory
apt_pkg.config.set("Dir::Cache::pkgcache", "")
@@ -87,6 +91,11 @@ class Cache(object):
# recognized (LP: #320665)
apt_pkg.init_system()
self.open(progress)
+
+
+ def _inc_changes_count(self):
+ """Increase the number of changes"""
+ self._changes_count += 1
def _check_and_create_required_dirs(self, rootdir):
"""