From: Zac Medico Date: Sun, 5 Jun 2011 08:14:07 +0000 (-0700) Subject: dbapi._iter_match: remove redundant myrepo args X-Git-Tag: v2.2.0_alpha38~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d51baaba0d5cad0fc7941bd593915b1fc7f42f94;p=portage.git dbapi._iter_match: remove redundant myrepo args The myrepo arguments are redundant since the Atom.repo attribute carries the same information. --- diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 40631e0bd..e386faae5 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -123,33 +123,33 @@ class dbapi(object): return list(self._iter_match(mydep, self.cp_list(mydep.cp, use_cache=use_cache))) - def _iter_match(self, atom, cpv_iter, myrepo=None): + def _iter_match(self, atom, cpv_iter): cpv_iter = iter(match_from_list(atom, cpv_iter)) if atom.slot: - cpv_iter = self._iter_match_slot(atom, cpv_iter, myrepo) + cpv_iter = self._iter_match_slot(atom, cpv_iter) if atom.unevaluated_atom.use: - cpv_iter = self._iter_match_use(atom, cpv_iter, myrepo) + cpv_iter = self._iter_match_use(atom, cpv_iter) if atom.repo: - cpv_iter = self._iter_match_repo(atom, cpv_iter, myrepo) + cpv_iter = self._iter_match_repo(atom, cpv_iter) return cpv_iter - def _iter_match_repo(self, atom, cpv_iter, myrepo=None): + def _iter_match_repo(self, atom, cpv_iter): for cpv in cpv_iter: try: - if self.aux_get(cpv, ["repository"], myrepo=myrepo)[0] == atom.repo: + if self.aux_get(cpv, ["repository"], myrepo=atom.repo)[0] == atom.repo: yield cpv except KeyError: continue - def _iter_match_slot(self, atom, cpv_iter, myrepo=None): + def _iter_match_slot(self, atom, cpv_iter): for cpv in cpv_iter: try: - if self.aux_get(cpv, ["SLOT"], myrepo=myrepo)[0] == atom.slot: + if self.aux_get(cpv, ["SLOT"], myrepo=atom.repo)[0] == atom.slot: yield cpv except KeyError: continue - def _iter_match_use(self, atom, cpv_iter, myrepo = None): + def _iter_match_use(self, atom, cpv_iter): """ 1) Check for required IUSE intersection (need implicit IUSE here). 2) Check enabled/disabled flag states. @@ -158,7 +158,7 @@ class dbapi(object): iuse_implicit_match = self.settings._iuse_implicit_match for cpv in cpv_iter: try: - iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"], myrepo=myrepo) + iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"], myrepo=atom.repo) except KeyError: continue iuse = frozenset(x.lstrip('+-') for x in iuse.split()) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a30c9d7b4..f971468a6 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -904,13 +904,13 @@ class portdbapi(dbapi): #dep match -- find all visible matches #get all visible packages, then get the matching ones myval = list(self._iter_match(mydep, - self.xmatch("list-visible", mykey, mydep=mykey, mykey=mykey), myrepo=mydep.repo)) + self.xmatch("list-visible", mykey, mydep=mykey, mykey=mykey))) elif level == "match-all": #match *all* visible *and* masked packages if mydep == mykey: myval = self.cp_list(mykey) else: - myval = list(self._iter_match(mydep, self.cp_list(mykey), myrepo = mydep.repo)) + myval = list(self._iter_match(mydep, self.cp_list(mykey))) else: raise AssertionError( "Invalid level argument: '%s'" % level)