summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-05-27 10:16:19 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-05-27 10:16:19 +0000
commit2cfce7a05a4c71c79fe62b83a72fe1d83e11e22b (patch)
treeea3cf7c03fae147ad9d89b523f90a3f80a6d136d /python/cache.cc
parentf5ffcecfc7630c019641e45c2185ef058e62e1a4 (diff)
downloadpython-apt-2cfce7a05a4c71c79fe62b83a72fe1d83e11e22b.tar.gz
* make better use of the cachefile in the depcache, avoid a stupid double depcache building
Diffstat (limited to 'python/cache.cc')
-rw-r--r--python/cache.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/python/cache.cc b/python/cache.cc
index 850a97de..cf5e963b 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -72,7 +72,8 @@ static PyObject *CreateProvides(PyObject *Owner,pkgCache::PrvIterator I)
// ---------------------------------------------------------------------
static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args)
{
- pkgCacheFile *Cache = GetCpp<pkgCacheFile *>(Self);
+ PyObject *CacheFilePy = GetOwner<pkgCache*>(Self);
+ pkgCacheFile *Cache = GetCpp<pkgCacheFile*>(CacheFilePy);
PyObject *pyOpProgressInst = 0;
PyObject *pyFetchProgressInst = 0;
@@ -208,10 +209,10 @@ PyTypeObject PkgCacheFileType =
PyObject_HEAD_INIT(&PyType_Type)
0, // ob_size
"pkgCacheFile", // tp_name
- sizeof(CppOwnedPyObject<pkgCacheFile>), // tp_basicsize
+ sizeof(CppOwnedPyObject<pkgCacheFile*>), // tp_basicsize
0, // tp_itemsize
// Methods
- CppOwnedDealloc<pkgCacheFile>, // tp_dealloc
+ CppOwnedDealloc<pkgCacheFile*>, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
@@ -797,14 +798,16 @@ PyTypeObject RDepListType =
/*}}}*/
+
+
PyObject *TmpGetCache(PyObject *Self,PyObject *Args)
{
- pkgCacheFile *Cache = new pkgCacheFile();
-
PyObject *pyCallbackInst = 0;
if (PyArg_ParseTuple(Args, "|O", &pyCallbackInst) == 0)
return 0;
+ pkgCacheFile *Cache = new pkgCacheFile();
+
if(pyCallbackInst != 0) {
PyOpProgress progress;
progress.setCallbackInst(pyCallbackInst);
@@ -816,8 +819,8 @@ PyObject *TmpGetCache(PyObject *Self,PyObject *Args)
return HandleErrors();
}
- CppOwnedPyObject<pkgCacheFile> *CacheFileObj =
- CppOwnedPyObject_NEW<pkgCacheFile>(0,&PkgCacheFileType, *Cache);
+ CppOwnedPyObject<pkgCacheFile*> *CacheFileObj =
+ CppOwnedPyObject_NEW<pkgCacheFile*>(0,&PkgCacheFileType, Cache);
CppOwnedPyObject<pkgCache *> *CacheObj =
CppOwnedPyObject_NEW<pkgCache *>(CacheFileObj,&PkgCacheType,