diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-09-19 22:01:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-09-19 22:01:07 +0000 |
commit | 153e3d641545fab537bee32c5390dc1a738cd34c (patch) | |
tree | 2632b2306d6a064725285aaf615cb21f4299c491 | |
parent | 5edab61aedce735f1bdf3fb52330a925fa50a93c (diff) | |
download | portage-153e3d641545fab537bee32c5390dc1a738cd34c.tar.gz portage-153e3d641545fab537bee32c5390dc1a738cd34c.tar.bz2 portage-153e3d641545fab537bee32c5390dc1a738cd34c.zip |
Mask binary packages if their CHOST does not match the one defined in make.conf.
svn path=/main/trunk/; revision=7792
-rw-r--r-- | pym/emerge/__init__.py | 28 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 2 |
2 files changed, 23 insertions, 7 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 6dd5371e3..48d1c27d1 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -1766,12 +1766,19 @@ class depgraph(object): "--usepkg" in self.myopts: # The next line assumes the binarytree has been populated. # XXX: Need to work out how we use the binary tree with roots. - myeb_pkg_matches = bindb.match(x) - if "--usepkgonly" not in self.myopts: - # Remove any binary package entries that are masked in the portage tree (#55871) - myeb_pkg_matches = [pkg for pkg in myeb_pkg_matches \ - if pkg in myeb_matches or \ - not portdb.cpv_exists(pkg)] + usepkgonly = "--usepkgonly" in self.myopts + chost = pkgsettings["CHOST"] + myeb_pkg_matches = [] + for pkg in bindb.match(x): + if chost != bindb.aux_get(pkg, ["CHOST"])[0]: + continue + # Remove any binary package entries that are + # masked in the portage tree (#55871). + if not usepkgonly and \ + not (pkg in myeb_matches or \ + not portdb.cpv_exists(pkg)): + continue + myeb_pkg_matches.append(pkg) if myeb_pkg_matches: myeb_pkg = portage.best(myeb_pkg_matches) # For best performance, try to reuse an exising node @@ -1917,6 +1924,15 @@ class depgraph(object): print "For more information, see MASKED PACKAGES section in the emerge man page or " print "refer to the Gentoo Handbook." else: + alleb = bindb.match(x) + if alleb: + chost = pkgsettings["CHOST"] + for p in alleb: + mreasons = [] + pkg_chost = bindb.aux_get(p, ["CHOST"])[0] + if chost != pkg_chost: + mreasons.append("CHOST: %s" % pkg_chost) + print "- "+p+" (masked by: "+", ".join(mreasons)+")" print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) print "!!! Either add a suitable binary package or compile from an ebuild." else: diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 9898639e1..e8e114fa4 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -27,7 +27,7 @@ class bindbapi(fakedbapi): self.settings = settings self._match_cache = {} # Selectively cache metadata in order to optimize dep matching. - self._aux_cache_keys = set(["SLOT"]) + self._aux_cache_keys = set(["CHOST","SLOT"]) self._aux_cache = {} def match(self, *pargs, **kwargs): |