diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-12-06 13:13:46 +0000 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-12-06 13:13:46 +0000 |
| commit | 712fd8a6948cc3f11de57f7abf598a8df18a646b (patch) | |
| tree | bf5d18b755cd1ac318ddcbc347c7c26ec66ccc34 | |
| parent | e17b802158234e43560e3d82436f745cb159d798 (diff) | |
| download | python-apt-712fd8a6948cc3f11de57f7abf598a8df18a646b.tar.gz | |
* bugfix in the acquire.FetchNeeded code
| -rw-r--r-- | doc/examples/acquire.py | 11 | ||||
| -rw-r--r-- | python/acquire.cc | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index 2736ad9c..516a3d6d 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -16,6 +16,17 @@ recs = apt_pkg.GetPkgRecords(cache) list = apt_pkg.GetPkgSourceList() list.ReadMainList() +# show the amount fetch needed for a dist-upgrade +depcache.Upgrade(True) +progress = apt.progress.TextFetchProgress() +fetcher = apt_pkg.GetAcquire(progress) +pm = apt_pkg.GetPackageManager(depcache) +pm.GetArchives(fetcher,list,recs) +print "%s (%s)" % (apt_pkg.SizeToStr(fetcher.FetchNeeded), fetcher.FetchNeeded) + +for pkg in cache.Packages: + depcache.MarkKeep(pkg) + try: os.mkdir("/tmp/pyapt-test") os.mkdir("/tmp/pyapt-test/partial") diff --git a/python/acquire.cc b/python/acquire.cc index 9d30e663..97064c43 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -129,11 +129,11 @@ static PyObject *AcquireAttr(PyObject *Self,char *Name) pkgAcquire *fetcher = GetCpp<pkgAcquire*>(Self); if(strcmp("TotalNeeded",Name) == 0) - return Py_BuildValue("l", fetcher->TotalNeeded()); + return Py_BuildValue("d", fetcher->TotalNeeded()); if(strcmp("FetchNeeded",Name) == 0) - return Py_BuildValue("l", fetcher->FetchNeeded()); + return Py_BuildValue("d", fetcher->FetchNeeded()); if(strcmp("PartialPresent",Name) == 0) - return Py_BuildValue("l", fetcher->PartialPresent()); + return Py_BuildValue("d", fetcher->PartialPresent()); if(strcmp("Items",Name) == 0) { PyObject *List = PyList_New(0); |
