summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog3
-rw-r--r--python/cache.cc8
2 files changed, 10 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index c79ede07..7326ed09 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,7 +14,8 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low
* python/cache.cc:
- Check that 2nd argument to Cache.update() really is a SourceList object.
- Fix PackageFile.not_automatic to use NotAutomatic instead of NotSource.
- - Add Package.has_versions to see which packages have at least one version.
+ - Add Package.has_versions to see which packages have at least one version,
+ and Package.has_provides for provides.
- Add rich compare methods to the Version object.
* python/generic.cc:
- Fix a memory leak when using old attribute names.
diff --git a/python/cache.cc b/python/cache.cc
index 03c453a1..4d7c347a 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -539,6 +539,12 @@ static PyObject *PackageGetHasVersions(PyObject *Self,void*)
return PyBool_FromLong(Pkg.VersionList().end() == false);
}
+static PyObject *PackageGetHasProvides(PyObject *Self,void*)
+{
+ pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(Self);
+ return PyBool_FromLong(Pkg.ProvidesList().end() == false);
+}
+
static PyObject *PackageGetCurrentVer(PyObject *Self,void*)
{
pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(Self);
@@ -592,6 +598,8 @@ static PyGetSetDef PackageGetSet[] = {
"The version of the package currently installed or None."},
{"has_versions",PackageGetHasVersions,0,
"Whether the package has at least one version in the cache."},
+ {"has_provides",PackageGetHasProvides,0,
+ "Whether the package is provided by at least one other package."},
{}
};