From 170c310e75aa0bc417cb67f6e560fdaab482d72e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Jan 2006 23:27:33 +0000 Subject: * added support for pkgIndexFile --- doc/examples/indexfile.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/examples/indexfile.py (limited to 'doc') diff --git a/doc/examples/indexfile.py b/doc/examples/indexfile.py new file mode 100644 index 00000000..e7f81e61 --- /dev/null +++ b/doc/examples/indexfile.py @@ -0,0 +1,20 @@ + +import apt_pkg + +apt_pkg.init() + +sources = apt_pkg.GetPkgSourceList() +sources.ReadMainList() + +cache = apt_pkg.GetCache() +depcache = apt_pkg.GetDepCache(cache) +pkg = cache["bzr"] +cand = depcache.GetCandidateVer(pkg) +for (f,i) in cand.FileList: + index = sources.FindIndex(f) + print index + if index: + print index.Size + print index.IsTrusted + print index.Exists + print index.HasPackages -- cgit v1.2.3