summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-07-31 11:42:55 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2008-07-31 11:42:55 +0200
commitb4d0f3a1c38d916c2abda67549a454467a05fb1f (patch)
tree7d5776b295fc7af1a84a1d2c7e8123b2945aa157
parentd6343253aa4025376b9a8bb2b2fa140819def747 (diff)
downloadpython-apt-b4d0f3a1c38d916c2abda67549a454467a05fb1f.tar.gz
fix GetCandidateVer() reporting incorrect versions after
SetCandidateVer() was used. Thanks to Julian Andres Klode for the test-case (LP: #237372)
-rw-r--r--debian/changelog3
-rw-r--r--po/python-apt.pot2
-rw-r--r--python/depcache.cc6
3 files changed, 8 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 86e5b0c9..1afcb16e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ python-apt (0.7.7.2) UNRELEASED; urgency=low
* python/cache.cc:
- fix crash if Ver.PriorityType() returns NULL
+ - fix GetCandidateVer() reporting incorrect versions after
+ SetCandidateVer() was used. Thanks to Julian Andres Klode for
+ the test-case (LP: #237372)
* apt/cache.py:
- support "in" in apt.Cache() (LP: #251587)
diff --git a/po/python-apt.pot b/po/python-apt.pot
index 9dc6e202..20905fdf 100644
--- a/po/python-apt.pot
+++ b/po/python-apt.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-30 10:24+0200\n"
+"POT-Creation-Date: 2008-07-31 11:40+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/python/depcache.cc b/python/depcache.cc
index 5664a6d8..2446dc71 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -197,7 +197,7 @@ static PyObject *PkgDepCacheSetCandidateVer(PyObject *Self,PyObject *Args)
return 0;
pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj);
- pkgCache::VerIterator I = GetCpp<pkgCache::VerIterator>(VersionObj);
+ pkgCache::VerIterator &I = GetCpp<pkgCache::VerIterator>(VersionObj);
if(I.end()) {
return HandleErrors(Py_BuildValue("b",false));
}
@@ -215,7 +215,9 @@ static PyObject *PkgDepCacheGetCandidateVer(PyObject *Self,PyObject *Args)
return 0;
pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj);
- pkgCache::VerIterator I = depcache->GetCandidateVer(Pkg);
+ pkgDepCache::StateCache & State = (*depcache)[Pkg];
+ pkgCache::VerIterator I = State.CandidateVerIter(*depcache);
+
if(I.end()) {
Py_INCREF(Py_None);
return Py_None;