summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-12-06 13:13:46 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-12-06 13:13:46 +0000
commit712fd8a6948cc3f11de57f7abf598a8df18a646b (patch)
treebf5d18b755cd1ac318ddcbc347c7c26ec66ccc34 /doc/examples
parente17b802158234e43560e3d82436f745cb159d798 (diff)
downloadpython-apt-712fd8a6948cc3f11de57f7abf598a8df18a646b.tar.gz
* bugfix in the acquire.FetchNeeded code
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/acquire.py11
1 files changed, 11 insertions, 0 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")