summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/__init__.py15
-rw-r--r--pym/portage/__init__.py4
-rw-r--r--pym/portage/dbapi/porttree.py5
3 files changed, 18 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index eb6ea9a35..0f15e416a 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1387,8 +1387,8 @@ def visible(pkgsettings, pkg):
"""
if not pkg.metadata["SLOT"]:
return False
- if pkg.built and not pkg.installed and "CHOST" in pkg.metadata:
- if not pkgsettings._accept_chost(pkg):
+ if not pkg.installed:
+ if not pkgsettings._accept_chost(pkg.cpv, pkg.metadata):
return False
eapi = pkg.metadata["EAPI"]
if not portage.eapi_is_supported(eapi):
@@ -1415,8 +1415,8 @@ def get_masking_status(pkg, pkgsettings, root_config):
pkg, settings=pkgsettings,
portdb=root_config.trees["porttree"].dbapi)
- if pkg.built and not pkg.installed and "CHOST" in pkg.metadata:
- if not pkgsettings._accept_chost(pkg):
+ if not pkg.installed:
+ if not pkgsettings._accept_chost(pkg.cpv, pkg.metadata):
mreasons.append("CHOST: %s" % \
pkg.metadata["CHOST"])
@@ -1436,6 +1436,7 @@ def get_mask_info(root_config, cpv, pkgsettings,
if metadata and not built:
pkgsettings.setcpv(cpv, mydb=metadata)
metadata["USE"] = pkgsettings["PORTAGE_USE"]
+ metadata['CHOST'] = pkgsettings.get('CHOST', '')
if metadata is None:
mreasons = ["corruption"]
else:
@@ -5468,6 +5469,7 @@ class depgraph(object):
cpv=mykey, metadata=metadata, onlydeps=onlydeps)
pkgsettings.setcpv(pkg)
pkg.metadata["USE"] = pkgsettings["PORTAGE_USE"]
+ pkg.metadata['CHOST'] = pkgsettings.get('CHOST', '')
self._pkg_cache[pkg] = pkg
args.append(PackageArg(arg=x, package=pkg,
root_config=root_config))
@@ -6188,6 +6190,8 @@ class depgraph(object):
onlydeps=onlydeps, root_config=root_config,
type_name=pkg_type)
metadata = pkg.metadata
+ if not built:
+ metadata['CHOST'] = pkgsettings.get('CHOST', '')
if not built and ("?" in metadata["LICENSE"] or \
"?" in metadata["PROVIDE"]):
# This is avoided whenever possible because
@@ -6521,6 +6525,7 @@ class depgraph(object):
settings = self.pkgsettings[root_config.root]
settings.setcpv(pkg)
pkg.metadata["USE"] = settings["PORTAGE_USE"]
+ pkg.metadata['CHOST'] = settings.get('CHOST', '')
self._pkg_cache[pkg] = pkg
return pkg
@@ -8696,6 +8701,7 @@ class depgraph(object):
pkgsettings = self.pkgsettings[myroot]
pkgsettings.setcpv(pkg)
pkg.metadata["USE"] = pkgsettings["PORTAGE_USE"]
+ pkg.metadata['CHOST'] = pkgsettings.get('CHOST', '')
self._pkg_cache[pkg] = pkg
root_config = self.roots[pkg.root]
@@ -11439,6 +11445,7 @@ class Scheduler(PollScheduler):
settings = self.pkgsettings[root_config.root]
settings.setcpv(pkg)
pkg.metadata["USE"] = settings["PORTAGE_USE"]
+ pkg.metadata['CHOST'] = settings.get('CHOST', '')
return pkg
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 68f2dbbbd..b9365ff36 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2538,7 +2538,7 @@ class config(object):
ret.append(element)
return ret
- def _accept_chost(self, pkg):
+ def _accept_chost(self, cpv, metadata):
"""
@return True if pkg CHOST is accepted, False otherwise.
"""
@@ -2567,7 +2567,7 @@ class config(object):
self._accept_chost_re = re.compile("^$")
return self._accept_chost_re.match(
- pkg.metadata.get("CHOST", "")) is not None
+ metadata.get('CHOST', '')) is not None
def setinst(self,mycpv,mydbapi):
"""This updates the preferences for old-style virtuals,
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index dd2257afe..7ac281e8b 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -856,6 +856,8 @@ class portdbapi(dbapi):
aux_keys = list(self._aux_cache_keys)
metadata = {}
local_config = self.mysettings.local_config
+ chost = self.mysettings.get('CHOST', '')
+ accept_chost = self.mysettings._accept_chost
for mycpv in mylist:
metadata.clear()
try:
@@ -876,6 +878,9 @@ class portdbapi(dbapi):
if self.mysettings._getMissingKeywords(mycpv, metadata):
continue
if local_config:
+ metadata['CHOST'] = chost
+ if not accept_chost(mycpv, metadata):
+ continue
metadata["USE"] = ""
if "?" in metadata["LICENSE"]:
self.doebuild_settings.setcpv(mycpv, mydb=metadata)