From: Zac Medico Date: Tue, 2 Jan 2007 10:42:50 +0000 (-0000) Subject: Optimize dep_zapdeps to work without a vartree when called by repoman. X-Git-Tag: v2.1.2~173 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8254b3197ecc20fcb260159c9917b923ebaae6a2;p=portage.git Optimize dep_zapdeps to work without a vartree when called by repoman. svn path=/main/trunk/; revision=5444 --- diff --git a/bin/repoman b/bin/repoman index fabde2821..f3fb731d4 100755 --- a/bin/repoman +++ b/bin/repoman @@ -477,7 +477,7 @@ trees["/"]["porttree"].settings = repoman_settings portdb = trees["/"]["porttree"].dbapi portdb.mysettings = repoman_settings # dep_zapdeps looks at the vardbapi, but it shouldn't for repoman. -trees["/"]["vartree"].dbapi = portage.fakedbapi(settings=repoman_settings) +del trees["/"]["vartree"] if not myreporoot: myreporoot = os.path.basename(portdir_overlay) diff --git a/pym/portage.py b/pym/portage.py index 685ba9568..3903d3dde 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3962,7 +3962,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): other = [] # Alias the trees we'll be checking availability against - vardb = trees[myroot]["vartree"].dbapi + vardb = None + if "vartree" in trees[myroot]: + vardb = trees[myroot]["vartree"].dbapi if use_binaries: mydbapi = trees[myroot]["bintree"].dbapi else: @@ -3977,6 +3979,17 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): else: atoms = [dep] + all_available = True + for atom in atoms: + if not mydbapi.match(atom): + all_available = False + break + + if not vardb: + # called by repoman + preferred.append((atoms, None, all_available)) + continue + """ The package names rather than the exact atoms are used for an initial rough match against installed packages. More specific preference selection is handled later via slot and version comparison.""" @@ -3987,12 +4000,6 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): all_installed = False break - all_available = True - for atom in atoms: - if not mydbapi.match(atom): - all_available = False - break - # Check if the set of atoms will result in a downgrade of # an installed package. If they will then don't prefer them # over other atoms.