diff options
| -rw-r--r-- | apt/cache.py | 11 | ||||
| -rw-r--r-- | debian/changelog | 13 | ||||
| -rw-r--r-- | python/apt_pkgmodule.cc | 5 | ||||
| -rw-r--r-- | python/sourcelist.cc | 6 |
4 files changed, 32 insertions, 3 deletions
diff --git a/apt/cache.py b/apt/cache.py index dc2f5522..a92bd5be 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -122,6 +122,17 @@ class Cache(object): self._depcache.Upgrade(distUpgrade) self.cachePostChange() + @property + def reqReinstallPkgs(self): + " return the packages not downloadable packages in reqreinst state " + reqreinst = set() + for pkg in self: + if (not pkg.candidateDownloadable and + (pkg._pkg.InstState == apt_pkg.InstStateReInstReq or + pkg._pkg.InstState == apt_pkg.InstStateHoldReInstReq)): + reqreinst.add(pkg.name) + return reqreinst + def _runFetcher(self, fetcher): # do the actual fetching res = fetcher.Run() diff --git a/debian/changelog b/debian/changelog index 671a0b17..56ee5c7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +python-apt (0.7.4ubuntu5) hardy; urgency=low + + * python/sourcelist.cc: + - support GetIndexes() GetAll argument to implement + something like --print-uris + * python/apt_pkgmodule.cc: + - add InstState{Ok,ReInstReq,Hold,HoldReInstReq} constants + * apt/cache.py: + - add reqReinstallPkgs property that lists all packages in + ReInstReq or HoldReInstReq + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 18 Feb 2008 16:55:51 +0100 + python-apt (0.7.4ubuntu4) hardy; urgency=low * python/pkgrecords.cc: diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 15f7d238..ae1cf7be 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -507,6 +507,11 @@ extern "C" void initapt_pkg() AddInt(Dict,"CurStateHalfInstalled",pkgCache::State::HalfInstalled); AddInt(Dict,"CurStateConfigFiles",pkgCache::State::ConfigFiles); AddInt(Dict,"CurStateInstalled",pkgCache::State::Installed); + + AddInt(Dict,"InstStateOk",pkgCache::State::Ok); + AddInt(Dict,"InstStateReInstReq",pkgCache::State::ReInstReq); + AddInt(Dict,"InstStateHold",pkgCache::State::Hold); + AddInt(Dict,"InstStateHoldReInstReq",pkgCache::State::HoldReInstReq); } /*}}}*/ diff --git a/python/sourcelist.cc b/python/sourcelist.cc index 68b764f8..76df015d 100644 --- a/python/sourcelist.cc +++ b/python/sourcelist.cc @@ -60,12 +60,12 @@ static PyObject *PkgSourceListGetIndexes(PyObject *Self,PyObject *Args) pkgSourceList *list = GetCpp<pkgSourceList*>(Self); PyObject *pyFetcher; - - if (PyArg_ParseTuple(Args, "O!",&PkgAcquireType,&pyFetcher) == 0) + char all = 0; + if (PyArg_ParseTuple(Args, "O!|b",&PkgAcquireType,&pyFetcher, &all) == 0) return 0; pkgAcquire *fetcher = GetCpp<pkgAcquire*>(pyFetcher); - bool res = list->GetIndexes(fetcher); + bool res = list->GetIndexes(fetcher, all); return HandleErrors(Py_BuildValue("b",res)); } |
