diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-08-08 14:31:24 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-08-08 14:31:24 +0000 |
| commit | 1e6a73d6bcb6b5e1d8e3f965c4e1c44a0aac33e4 (patch) | |
| tree | 70e7ad1ba81a3cfc7fae3da70669a1e624c5f0c7 | |
| parent | 33b997bc26cfdb50e9845ff925d10a2d0fda79e3 (diff) | |
| download | python-apt-1e6a73d6bcb6b5e1d8e3f965c4e1c44a0aac33e4.tar.gz | |
* support for srcrecords.Files added
| -rw-r--r-- | debian/changelog | 6 | ||||
| -rwxr-xr-x | doc/examples/build-deps.py | 2 | ||||
| -rw-r--r-- | python/cache.cc | 5 | ||||
| -rw-r--r-- | python/pkgsrcrecords.cc | 22 |
4 files changed, 29 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 33bc5d25..39196d01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,12 @@ python-apt (0.6.14) unstable; urgency=low * doc/examples/build-deps.py: - fixed/improved (thanks to Martin Michlmayr, closes: #321507) + * apt_pkg.Cache.Update() does no longer reopen the cache + (this is the job of the caller now) + * python/srcrecords.cc: + - support for "srcrecords.Files" added - -- + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 8 Aug 2005 16:24:22 +0200 python-apt (0.6.13) unstable; urgency=low diff --git a/doc/examples/build-deps.py b/doc/examples/build-deps.py index 03c1f4ab..b580f5de 100755 --- a/doc/examples/build-deps.py +++ b/doc/examples/build-deps.py @@ -44,6 +44,8 @@ if not srcpkg_name: print "Can't find source package for '%s'" % pkg.Name srcrec = srcrecords.Lookup(srcpkg_name) if srcrec: + print "Files:" + print srcrecords.Files bd = srcrecords.BuildDepends print "build-depends of the package: %s " % bd for b in bd: diff --git a/python/cache.cc b/python/cache.cc index c0d9048b..5c1760d4 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -105,7 +105,8 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } - +#if 0 // reopening the cache is the job of the python code now + // doing it here is wrong and broken if(pyOpProgressInst != 0) { PyOpProgress progress; progress.setCallbackInst(pyOpProgressInst); @@ -118,7 +119,7 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) return HandleErrors(Py_None); } } - +#endif Py_INCREF(Py_None); return HandleErrors(Py_None); diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index ac6c09fd..c9adcb1a 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -82,9 +82,25 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name) PyList_Append(List, CppPyString(*b)); return List; // todo - } else if (strcmp("Files",Name) == 0) - return 0; // todo - else if (strcmp("BuildDepends",Name) == 0) { + } else if (strcmp("Files",Name) == 0) { + PyObject *List = PyList_New(0); + + vector<pkgSrcRecords::File> f; + if(!Struct.Last->Files(f)) + return NULL; // error + + PyObject *v; + for(unsigned int i=0;i<f.size();i++) { + v = Py_BuildValue("(siss)", + f[i].MD5Hash.c_str(), + f[i].Size, + f[i].Path.c_str(), + f[i].Type.c_str()); + PyList_Append(List, v); + Py_DECREF(v); + } + return List; + } else if (strcmp("BuildDepends",Name) == 0) { PyObject *List = PyList_New(0); vector<pkgSrcRecords::Parser::BuildDepRec> bd; |
