summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/bintree.py14
-rw-r--r--pym/portage/dep/__init__.py4
-rw-r--r--pym/portage/dep/dep_check.py5
-rw-r--r--pym/portage/package/ebuild/doebuild.py12
4 files changed, 7 insertions, 28 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 9b1535e49..b4e240783 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -18,7 +18,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
from portage.cache.mappings import slot_dict_class
from portage.dbapi.virtual import fakedbapi
-from portage.dep import use_reduce, paren_enclose
+from portage.dep import Atom, use_reduce, paren_enclose
from portage.exception import InvalidPackageName, \
PermissionDenied, PortageException
from portage.localization import _
@@ -1087,22 +1087,12 @@ class binarytree(object):
for k in self._pkgindex_use_evaluated_keys:
try:
deps = metadata[k]
- deps = use_reduce(deps, uselist=raw_use)
+ deps = use_reduce(deps, uselist=raw_use, token_class=Atom)
deps = paren_enclose(deps)
except portage.exception.InvalidDependString as e:
writemsg("%s: %s\n" % (k, str(e)),
noiselevel=-1)
raise
- if k in _vdb_use_conditional_atoms:
- v_split = []
- for x in deps.split():
- try:
- x = portage.dep.Atom(x)
- except portage.exception.InvalidAtom:
- v_split.append(x)
- else:
- v_split.append(str(x.evaluate_conditionals(raw_use)))
- deps = ' '.join(v_split)
metadata[k] = deps
def exists_specific(self, cpv):
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index c6bd4ea21..8a31b3f6d 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -486,6 +486,10 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
raise portage.exception.InvalidDependString(
_("Invalid token '%s' in '%s', token %s") % (token, depstr, pos+1))
+ if not matchall and \
+ hasattr(token, 'evaluate_conditionals'):
+ token = token.evaluate_conditionals(uselist)
+
stack[level].append(token)
if level != 0:
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 9b4e97097..bfbdc608e 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -80,11 +80,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if repoman:
x = x._eval_qa_conditionals(use_mask, use_force)
- if not repoman and \
- myuse is not None and x.use:
- if x.use.conditional:
- x = x.evaluate_conditionals(myuse)
-
mykey = x.cp
if not mykey.startswith("virtual/"):
newsplit.append(x)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index af4ee5ef4..9b2e3e8e7 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1463,20 +1463,10 @@ def _post_src_install_uid_fix(mysettings, out):
v = mysettings.configdict['pkg'].get(k)
if v is None:
continue
- v = use_reduce(v, uselist=use)
+ v = use_reduce(v, uselist=use, token_class=Atom)
v = paren_enclose(v)
if not v:
continue
- if v in _vdb_use_conditional_atoms:
- v_split = []
- for x in v.split():
- try:
- x = Atom(x)
- except InvalidAtom:
- v_split.append(x)
- else:
- v_split.append(str(x.evaluate_conditionals(use)))
- v = ' '.join(v_split)
codecs.open(_unicode_encode(os.path.join(build_info_dir,
k), encoding=_encodings['fs'], errors='strict'),
mode='w', encoding=_encodings['repo.content'],