Lines 3367-3373
Link Here
|
3367 |
return 1 |
3367 |
return 1 |
3368 |
|
3368 |
|
3369 |
def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, |
3369 |
def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, |
3370 |
return_all_deps=False): |
3370 |
fakedb=None, return_all_deps=False): |
3371 |
"""Takes an unreduced and reduced deplist and removes satisfied dependencies. |
3371 |
"""Takes an unreduced and reduced deplist and removes satisfied dependencies. |
3372 |
Returned deplist contains steps that must be taken to satisfy dependencies.""" |
3372 |
Returned deplist contains steps that must be taken to satisfy dependencies.""" |
3373 |
if trees is None: |
3373 |
if trees is None: |
Lines 3384-3390
Link Here
|
3384 |
if isinstance(dep, list): |
3384 |
if isinstance(dep, list): |
3385 |
unresolved += dep_zapdeps(dep, satisfied, myroot, |
3385 |
unresolved += dep_zapdeps(dep, satisfied, myroot, |
3386 |
use_binaries=use_binaries, trees=trees, |
3386 |
use_binaries=use_binaries, trees=trees, |
3387 |
return_all_deps=return_all_deps) |
3387 |
fakedb=fakedb, return_all_deps=return_all_deps) |
3388 |
elif not satisfied or return_all_deps: |
3388 |
elif not satisfied or return_all_deps: |
3389 |
unresolved.append(dep) |
3389 |
unresolved.append(dep) |
3390 |
return unresolved |
3390 |
return unresolved |
Lines 3403-3409
Link Here
|
3403 |
other = [] |
3403 |
other = [] |
3404 |
|
3404 |
|
3405 |
# Alias the trees we'll be checking availability against |
3405 |
# Alias the trees we'll be checking availability against |
3406 |
vardb = trees[myroot]["vartree"].dbapi |
3406 |
if fakedb: |
|
|
3407 |
vardb = fakedb |
3408 |
else: |
3409 |
vardb = trees[myroot]["vartree"].dbapi |
3407 |
if use_binaries: |
3410 |
if use_binaries: |
3408 |
mydbapi = trees[myroot]["bintree"].dbapi |
3411 |
mydbapi = trees[myroot]["bintree"].dbapi |
3409 |
else: |
3412 |
else: |
Lines 3414-3420
Link Here
|
3414 |
for (dep, satisfied) in zip(deps, satisfieds): |
3417 |
for (dep, satisfied) in zip(deps, satisfieds): |
3415 |
if isinstance(dep, list): |
3418 |
if isinstance(dep, list): |
3416 |
atoms = dep_zapdeps(dep, satisfied, myroot, |
3419 |
atoms = dep_zapdeps(dep, satisfied, myroot, |
3417 |
use_binaries=use_binaries, trees=trees) |
3420 |
use_binaries=use_binaries, trees=trees, |
|
|
3421 |
fakedb=fakedb, return_all_deps=return_all_deps) |
3418 |
else: |
3422 |
else: |
3419 |
atoms = [dep] |
3423 |
atoms = [dep] |
3420 |
|
3424 |
|
Lines 3555-3562
Link Here
|
3555 |
writemsg("mysplit: %s\n" % (mysplit), 1) |
3559 |
writemsg("mysplit: %s\n" % (mysplit), 1) |
3556 |
writemsg("mysplit2: %s\n" % (mysplit2), 1) |
3560 |
writemsg("mysplit2: %s\n" % (mysplit2), 1) |
3557 |
|
3561 |
|
|
|
3562 |
fakedb = None |
3563 |
if return_all_deps: |
3564 |
fakedb = mydbapi |
3558 |
myzaps = dep_zapdeps(mysplit, mysplit2, myroot, |
3565 |
myzaps = dep_zapdeps(mysplit, mysplit2, myroot, |
3559 |
use_binaries=use_binaries, trees=trees, return_all_deps=return_all_deps) |
3566 |
use_binaries=use_binaries, trees=trees, |
|
|
3567 |
fakedb=fakedb, return_all_deps=return_all_deps) |
3560 |
mylist = flatten(myzaps) |
3568 |
mylist = flatten(myzaps) |
3561 |
writemsg("myzaps: %s\n" % (myzaps), 1) |
3569 |
writemsg("myzaps: %s\n" % (myzaps), 1) |
3562 |
writemsg("mylist: %s\n" % (mylist), 1) |
3570 |
writemsg("mylist: %s\n" % (mylist), 1) |
Lines 3998-4009
Link Here
|
3998 |
def cpv_all(self): |
4006 |
def cpv_all(self): |
3999 |
return self.cpvdict.keys() |
4007 |
return self.cpvdict.keys() |
4000 |
|
4008 |
|
4001 |
def cpv_inject(self,mycpv): |
4009 |
def cpv_inject(self, mycpv, myslot=None): |
4002 |
"""Adds a cpv from the list of available packages.""" |
4010 |
"""Adds a cpv from the list of available packages.""" |
4003 |
mycp=cpv_getkey(mycpv) |
4011 |
mycp=cpv_getkey(mycpv) |
4004 |
self.cpvdict[mycpv]=1 |
4012 |
self.cpvdict[mycpv] = myslot |
4005 |
if not self.cpdict.has_key(mycp): |
4013 |
if myslot and mycp in self.cpdict: |
4006 |
self.cpdict[mycp]=[] |
4014 |
# If necessary, remove another package in the same SLOT. |
|
|
4015 |
for cpv in self.cpdict[mycp]: |
4016 |
if mycpv != cpv and myslot == self.cpvdict[cpv]: |
4017 |
self.cpv_remove(cpv) |
4018 |
break |
4019 |
if mycp not in self.cpdict: |
4020 |
self.cpdict[mycp] = [] |
4007 |
if not mycpv in self.cpdict[mycp]: |
4021 |
if not mycpv in self.cpdict[mycp]: |
4008 |
self.cpdict[mycp].append(mycpv) |
4022 |
self.cpdict[mycp].append(mycpv) |
4009 |
|
4023 |
|
Lines 4029-4034
Link Here
|
4029 |
if not len(self.cpdict[mycp]): |
4043 |
if not len(self.cpdict[mycp]): |
4030 |
del self.cpdict[mycp] |
4044 |
del self.cpdict[mycp] |
4031 |
|
4045 |
|
|
|
4046 |
def aux_get(self, mycpv, wants): |
4047 |
if not self.cpv_exists(mycpv): |
4048 |
raise KeyError(mycpv) |
4049 |
values = [] |
4050 |
for x in wants: |
4051 |
if x == "SLOT": |
4052 |
values.append(self.cpvdict[mycpv]) |
4053 |
else: |
4054 |
values.append("") |
4055 |
return values |
4056 |
|
4032 |
class bindbapi(fakedbapi): |
4057 |
class bindbapi(fakedbapi): |
4033 |
def __init__(self, mybintree=None, settings=None): |
4058 |
def __init__(self, mybintree=None, settings=None): |
4034 |
self.bintree = mybintree |
4059 |
self.bintree = mybintree |