indexfile.py 485 Bytes
Newer Older
1
#!/usr/bin/python
2 3 4 5 6

import apt_pkg

apt_pkg.init()

7
sources = apt_pkg.SourceList()
8
sources.read_main_list()
9

10 11
cache = apt_pkg.Cache()
depcache = apt_pkg.DepCache(cache)
12
pkg = cache["libimlib2"]
13 14 15
cand = depcache.get_candidate_ver(pkg)
for (f, i) in cand.file_list:
    index = sources.find_index(f)
16 17
    print index
    if index:
18 19 20 21 22
        print index.size
        print index.is_trusted
        print index.exists
        print index.Haspackages
        print index.archive_uri("some/path")