summaryrefslogtreecommitdiff
path: root/doc/examples/depcache.py
blob: b3d720a5f335e143b9058b7375dbf0e515748258 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
# example how to deal with the depcache

import apt_pkg

def Update(Percent, data):
    pass

apt_pkg.init()
cache = apt_pkg.GetCache()
print cache.PackageCount

iter = cache["base-config"]
print iter

depcache = apt_pkg.GetDepCache(cache)
depcache.SetProgressCallback(Update, None)
depcache.Init()
print depcache
print depcache.InstCount

ver= depcache.GetCandidateVer(iter)
print ver