diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-07-31 11:42:55 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-07-31 11:42:55 +0200 |
| commit | b4d0f3a1c38d916c2abda67549a454467a05fb1f (patch) | |
| tree | 7d5776b295fc7af1a84a1d2c7e8123b2945aa157 /python | |
| parent | d6343253aa4025376b9a8bb2b2fa140819def747 (diff) | |
| download | python-apt-b4d0f3a1c38d916c2abda67549a454467a05fb1f.tar.gz | |
fix GetCandidateVer() reporting incorrect versions after
SetCandidateVer() was used. Thanks to Julian Andres Klode for
the test-case (LP: #237372)
Diffstat (limited to 'python')
| -rw-r--r-- | python/depcache.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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; |
