summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-14 00:37:02 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-14 00:37:02 +0000
commite6be6590e99522f9be69e2af8eff87919d9bf31f (patch)
tree0957b4fff3409c4a081f34596895cfb9446f6ed6
parent5f41b254c7c4b1f16a7916a757150b827a2c5b53 (diff)
downloadportage-e6be6590e99522f9be69e2af8eff87919d9bf31f.tar.gz
portage-e6be6590e99522f9be69e2af8eff87919d9bf31f.tar.bz2
portage-e6be6590e99522f9be69e2af8eff87919d9bf31f.zip
Evaluate conditional USE deps for *DEPEND atoms saved in vdb entries.
svn path=/main/trunk/; revision=15351
-rw-r--r--pym/portage/__init__.py11
-rw-r--r--pym/portage/dbapi/bintree.py10
2 files changed, 21 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 2e688fa0e..d7f3a7fb3 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5872,6 +5872,7 @@ def _post_src_install_chost_fix(settings):
_vdb_use_conditional_keys = ('DEPEND', 'LICENSE', 'PDEPEND',
'PROPERTIES', 'PROVIDE', 'RDEPEND', 'RESTRICT',)
+_vdb_use_conditional_atoms = frozenset(['DEPEND', 'PDEPEND', 'RDEPEND'])
def _post_src_install_uid_fix(mysettings, out=None):
"""
@@ -5994,6 +5995,16 @@ def _post_src_install_uid_fix(mysettings, out=None):
v = dep.paren_enclose(v)
if not v:
continue
+ if v in _vdb_use_conditional_atoms:
+ v_split = []
+ for x in v.split():
+ try:
+ x = dep.Atom(x)
+ except exception.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'],
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index e07f58a47..ecc8424c0 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -1049,6 +1049,16 @@ class binarytree(object):
writemsg("%s: %s\n" % (k, str(e)),
noiselevel=-1)
raise
+ if k in portage._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):