diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-29 11:05:40 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-29 11:05:40 +0200 |
| commit | 4775b948dcda187f03b765d7da2c00ea27834e9c (patch) | |
| tree | 4ae99e691995fdb26a2b9ce1e1f379747b0a771e /apt | |
| parent | 8c23a5f32378cc25f6a4480b4b58c6bb71d6862c (diff) | |
| download | python-apt-4775b948dcda187f03b765d7da2c00ea27834e9c.tar.gz | |
apt.Cache: Add a _changes_count member for later use
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/cache.py | 9 |
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): """ |
