summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-23 13:50:45 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-23 13:50:45 -0700
commit0d375f1105ad67c8b7e3b16b57cdbb367f99cd69 (patch)
tree6d3539b2e8959b9b1a0171e809360265b998618b
parentportdbapi.xmatch: fix minimum-all for multi-repo (diff)
downloadportage-0d375f1105ad67c8b7e3b16b57cdbb367f99cd69.tar.gz
portage-0d375f1105ad67c8b7e3b16b57cdbb367f99cd69.tar.bz2
portage-0d375f1105ad67c8b7e3b16b57cdbb367f99cd69.zip
portdbapi.xmatch: deprecate *match-list
These don't mesh well with multi-repo support.
-rw-r--r--pym/portage/dbapi/porttree.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index d42e41e65..ac583758a 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -989,23 +989,29 @@ class portdbapi(dbapi):
elif level == "bestmatch-list":
#dep match -- find best match but restrict search to sublist
- #no point in calling xmatch again since we're not caching list deps
-
+ warnings.warn("The 'bestmatch-list' mode of "
+ "portage.dbapi.porttree.portdbapi.xmatch is deprecated",
+ DeprecationWarning, stacklevel=2)
myval = best(list(self._iter_match(mydep, mylist)))
elif level == "match-list":
#dep match -- find all matches but restrict search to sublist (used in 2nd half of visible())
-
+ warnings.warn("The 'match-list' mode of "
+ "portage.dbapi.porttree.portdbapi.xmatch is deprecated",
+ DeprecationWarning, stacklevel=2)
myval = list(self._iter_match(mydep, mylist))
-
else:
raise AssertionError(
"Invalid level argument: '%s'" % level)
- if self.frozen and (level not in ["match-list", "bestmatch-list"]):
- self.xcache[level][mydep] = myval
- if origdep and origdep != mydep:
- self.xcache[level][origdep] = myval
- return myval[:]
+ if self.frozen:
+ xcache_this_level = self.xcache.get(level)
+ if xcache_this_level is not None:
+ xcache_this_level[mydep] = myval
+ if origdep and origdep != mydep:
+ xcache_this_level[origdep] = myval
+ myval = myval[:]
+
+ return myval
def match(self, mydep, use_cache=1):
return self.xmatch("match-visible", mydep)