From e2d599df4c4375fb90289d4d038c2575361a3b20 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 9 Mar 2005 13:25:10 +0000 Subject: * star-merged with my pkgDepCache branch Patches applied: * michael.vogt@ubuntu.com--2005/python-apt--pkgDepCache--0--patch-8 * merged with matt again, implemented DepCache.ReadPinFile(), fixed a bug in DepCache.Upgrade() * michael.vogt@ubuntu.com--2005/python-apt--pkgDepCache--0--patch-9 * added ReadPinFile to the depcache example code, added a comment to checkstate that there is also depcache that honors the default policy --- doc/examples/depcache.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/examples/depcache.py') diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py index 92416b3e..a5ecc240 100644 --- a/doc/examples/depcache.py +++ b/doc/examples/depcache.py @@ -13,6 +13,7 @@ print "example package iter: %s" % iter # get depcache depcache = apt_pkg.GetDepCache(cache) +depcache.ReadPinFile() print "got a depcache: %s " % depcache print "Marked for install: %s " % depcache.InstCount @@ -66,6 +67,11 @@ print "Delete: %s " % depcache.DelCount print "UsrSize: %s " % apt_pkg.SizeToStr(depcache.UsrSize) print "DebSize: %s " % apt_pkg.SizeToStr(depcache.DebSize) +for pkg in cache.Packages: + if pkg.CurrentVer != None and not depcache.MarkedInstall(pkg) and depcache.IsUpgradable(pkg): + print "Upgrade didn't upgrade (kept): %s" % pkg.Name + + print "\nPerforming DistUpgrade" depcache.Upgrade(True) print "Keep: %s " % depcache.KeepCount -- cgit v1.2.3