Can't create apt object :(
This commit is contained in:
parent
23cfa120ef
commit
0a1f821660
1 changed files with 8 additions and 7 deletions
|
@ -21,10 +21,7 @@
|
||||||
class BuildDependencyTieBreaker(object):
|
class BuildDependencyTieBreaker(object):
|
||||||
|
|
||||||
def __init__(self, rootdir):
|
def __init__(self, rootdir):
|
||||||
import apt_pkg
|
self.rootdir = rootdir
|
||||||
apt_pkg.init()
|
|
||||||
apt_pkg.config.set('Dir', rootdir)
|
|
||||||
self._apt_cache = apt_pkg.SourceRecords()
|
|
||||||
self._counts = None
|
self._counts = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -33,10 +30,14 @@ class BuildDependencyTieBreaker(object):
|
||||||
|
|
||||||
def _count(self):
|
def _count(self):
|
||||||
counts = {}
|
counts = {}
|
||||||
self._apt_cache.restart()
|
import apt_pkg
|
||||||
while self._apt_cache.step():
|
apt_pkg.init()
|
||||||
|
apt_pkg.config.set('Dir', self.rootdir)
|
||||||
|
apt_cache = apt_pkg.SourceRecords()
|
||||||
|
apt_cache.restart()
|
||||||
|
while apt_cache.step():
|
||||||
try:
|
try:
|
||||||
for d in self._apt_cache.build_depends.values():
|
for d in apt_cache.build_depends.values():
|
||||||
for o in d:
|
for o in d:
|
||||||
for p in o:
|
for p in o:
|
||||||
counts.setdefault(p[0], 0)
|
counts.setdefault(p[0], 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue