summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-02 10:42:50 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-02 10:42:50 +0000
commit8254b3197ecc20fcb260159c9917b923ebaae6a2 (patch)
tree62f6c410821ed95d5c849e4acc0a3459c4491196
parentff6aefe931380e74b6d6df1fd7d7297ab1e6552a (diff)
downloadportage-8254b3197ecc20fcb260159c9917b923ebaae6a2.tar.gz
portage-8254b3197ecc20fcb260159c9917b923ebaae6a2.tar.bz2
portage-8254b3197ecc20fcb260159c9917b923ebaae6a2.zip
Optimize dep_zapdeps to work without a vartree when called by repoman.
svn path=/main/trunk/; revision=5444
-rwxr-xr-xbin/repoman2
-rw-r--r--pym/portage.py21
2 files changed, 15 insertions, 8 deletions
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.