diff options
Diffstat (limited to 'doc/examples/indexfile.py')
| -rw-r--r-- | doc/examples/indexfile.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/examples/indexfile.py b/doc/examples/indexfile.py new file mode 100644 index 00000000..d383fd61 --- /dev/null +++ b/doc/examples/indexfile.py @@ -0,0 +1,21 @@ + +import apt_pkg + +apt_pkg.init() + +sources = apt_pkg.GetPkgSourceList() +sources.ReadMainList() + +cache = apt_pkg.GetCache() +depcache = apt_pkg.GetDepCache(cache) +pkg = cache["libimlib2"] +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 + print index.ArchiveURI("some/path") |
