From f398b1a5833fdf50f8c0c541958d5770ea767be8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Nov 2005 11:21:49 +0000 Subject: * fix in the pkgmanager.cc code (/me needs to be hit with a clue-stick) --- doc/examples/acquire.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'doc/examples') diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py index 0031fa18..a5de0029 100644 --- a/doc/examples/acquire.py +++ b/doc/examples/acquire.py @@ -1,9 +1,14 @@ import apt import apt_pkg import os +import sys apt_pkg.init() +#apt_pkg.Config.Set("Debug::pkgDPkgPM","1"); +#apt_pkg.Config.Set("Debug::pkgPackageManager","1"); +#apt_pkg.Config.Set("Debug::pkgDPkgProgressReporting","1"); + cache = apt_pkg.GetCache() depcache = apt_pkg.GetDepCache(cache) @@ -16,7 +21,7 @@ try: os.mkdir("/tmp/pyapt-test/partial") except OSError: pass -#apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test") +apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test") pkg = cache["3ddesktop"] depcache.MarkInstall(pkg) @@ -32,18 +37,19 @@ print fetcher pm.GetArchives(fetcher,list,recs) for item in fetcher.Items: - print "%s -> %s:\n Status: %s Complete: %s IsTrusted: %s" % (item.DescURI, - item.DestFile, - item.Status, - item.Complete, - item.IsTrusted) + print item if item.Status == item.StatError: print "Some error ocured: '%s'" % item.ErrorText if item.Complete == False: - print "No error, still nothing downloaded" + print "No error, still nothing downloaded (%s)" % item.ErrorText print res = fetcher.Run() print "fetcher.Run() returned: %s" % res +print "now runing pm.DoInstall()" +res = pm.DoInstall(1) +print "pm.DoInstall() returned: %s"% res + + -- cgit v1.2.3