summaryrefslogtreecommitdiff
path: root/apt/package.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-06-03 07:58:33 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-06-03 07:58:33 +0000
commit9103e321939804418a861cdaf25f8df1347d768b (patch)
tree8638d7c834bbc1ad57adcd25fbc48c3fcca5aa71 /apt/package.py
parentd2a55a7ccf141cd9706f62f87c74d10551f6a799 (diff)
downloadpython-apt-9103e321939804418a861cdaf25f8df1347d768b.tar.gz
* added reapplyFilter, added a CacheChanged() method that is used by the clients (e.s. the Packages class) when they install/remove etc something
Diffstat (limited to 'apt/package.py')
-rw-r--r--apt/package.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/apt/package.py b/apt/package.py
index 014b720f..8f1d00a0 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -2,12 +2,13 @@ import apt_pkg, string
class Package(object):
- def __init__(self, cache, depcache, records, pkgiter):
+ def __init__(self, cache, depcache, records, pcache, pkgiter):
""" Init the Package object """
- self._cache = cache
+ self._cache = cache # low level cache
self._depcache = depcache
self._records = records
self._pkg = pkgiter
+ self._pcache = pcache # python cache in cache.py
pass
# helper
@@ -18,6 +19,9 @@ class Package(object):
ver = self._depcache.GetCandidateVer(self._pkg)
else:
ver = self._pkg.CurrentVer
+ if ver.FileList == None:
+ print "got: %s " % ver.FileList
+ return
file, index = ver.FileList.pop(0)
self._records.Lookup((file,index))
@@ -112,11 +116,14 @@ class Package(object):
# depcache action
def MarkKeep(self):
- return self._depcache.MarkKeep(self._pkg)
+ self._depcache.MarkKeep(self._pkg)
+ self._pcache.CacheChange()
def MarkDelete(self):
- return self._depcache.MarkDelete(self._pkg)
+ self._depcache.MarkDelete(self._pkg)
+ self._pcache.CacheChange()
def MarkInstall(self):
return self._depcache.MarkInstall(self._pkg)
+ self._pcache.CacheChange()
# size
def PackageSize(self, UseCandidate=True):