From 2cfce7a05a4c71c79fe62b83a72fe1d83e11e22b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 27 May 2005 10:16:19 +0000 Subject: * make better use of the cachefile in the depcache, avoid a stupid double depcache building --- python/cache.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'python/cache.cc') 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(Self); + PyObject *CacheFilePy = GetOwner(Self); + pkgCacheFile *Cache = GetCpp(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), // tp_basicsize + sizeof(CppOwnedPyObject), // tp_basicsize 0, // tp_itemsize // Methods - CppOwnedDealloc, // tp_dealloc + CppOwnedDealloc, // 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 *CacheFileObj = - CppOwnedPyObject_NEW(0,&PkgCacheFileType, *Cache); + CppOwnedPyObject *CacheFileObj = + CppOwnedPyObject_NEW(0,&PkgCacheFileType, Cache); CppOwnedPyObject *CacheObj = CppOwnedPyObject_NEW(CacheFileObj,&PkgCacheType, -- cgit v1.2.3