summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-02-18 17:25:58 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-02-18 17:25:58 +0100
commit1b0216d7143a6275a404fcb729880b5ae4b2faa3 (patch)
treec1ac156f7037993732adcaf08fe91983c8ea0b89
parent28b6f80373ad00704615e1cb0aa9ef65a794771c (diff)
parent2885341cf3d7a1050be1bf2a45237395a3149feb (diff)
downloadpython-apt-1b0216d7143a6275a404fcb729880b5ae4b2faa3.tar.gz
merged from the mvo branch
-rw-r--r--debian/changelog9
-rw-r--r--debian/control2
-rw-r--r--python/depcache.cc30
3 files changed, 40 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 7f935923..00207cbe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+python-apt (0.7.100.1ubuntu5) UNRELEASEDnatty; urgency=low
+
+ * python/depcache.cc:
+ - provide bindings for new libapt SetCandidateRelease()
+ * debian/control:
+ - require new libapt-pkg-dev SetCandidateRelease()
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 18 Feb 2011 17:16:01 +0100
+
python-apt (0.7.100.1ubuntu4) natty; urgency=low
[ Michael Bienia ]
diff --git a/debian/control b/debian/control
index 14514645..73a4b57b 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ XS-Python-Version: >= 2.6
X-Python3-Version: >= 3.1
Build-Depends: apt-utils,
debhelper (>= 7.3.5),
- libapt-pkg-dev (>= 0.8),
+ libapt-pkg-dev (>= 0.8.11),
python-all-dev (>= 2.6.6-3~),
python-all-dbg,
python3-all-dev (>= 3.1.2-10~),
diff --git a/python/depcache.cc b/python/depcache.cc
index cfa4f5d6..12c13a73 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -184,6 +184,30 @@ static PyObject *PkgDepCacheCommit(PyObject *Self,PyObject *Args)
return HandleErrors(Py_None);
}
+static PyObject *PkgDepCacheSetCandidateRelease(PyObject *Self,PyObject *Args)
+{
+ bool Success;
+ PyObject *PackageObj;
+ PyObject *VersionObj;
+ const char *target_rel;
+ std::list<std::pair<pkgCache::VerIterator, pkgCache::VerIterator> > Changed;
+ if (PyArg_ParseTuple(Args,"O!O!s",
+ &PyPackage_Type, &PackageObj,
+ &PyVersion_Type, &VersionObj,
+ &target_rel) == 0)
+ return 0;
+
+ pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self);
+ pkgCache::VerIterator &I = GetCpp<pkgCache::VerIterator>(VersionObj);
+ if(I.end()) {
+ return HandleErrors(PyBool_FromLong(false));
+ }
+
+ Success = depcache->SetCandidateRelease(I, target_rel, Changed);
+
+ return HandleErrors(PyBool_FromLong(Success));
+}
+
static PyObject *PkgDepCacheSetCandidateVer(PyObject *Self,PyObject *Args)
{
pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self);
@@ -552,6 +576,12 @@ static PyMethodDef PkgDepCacheMethods[] =
{"set_candidate_ver",PkgDepCacheSetCandidateVer,METH_VARARGS,
"set_candidate_ver(pkg: apt_pkg.Package, ver: apt_pkg.Version) -> bool\n\n"
"Set the candidate version of 'pkg' to 'ver'."},
+ {"set_candidate_release",PkgDepCacheSetCandidateRelease,METH_VARARGS,
+ "set_candidate_release(pkg: apt_pkg.Package, ver: apt_pkg.Version, rel: string) -> bool\n\n"
+ "Sets not only the candidate version 'ver' for package 'pkg', "
+ "but walks also down the dependency tree and checks if it is required "
+ "to set the candidate of the dependency to a version from the given "
+ "release string 'rel', too."},
// global cache operations
{"upgrade",PkgDepCacheUpgrade,METH_VARARGS,