From: Fabian Groffen Date: Sat, 29 Sep 2007 20:47:55 +0000 (-0000) Subject: Moved EPREFIX check from late-die when installing a binary package to X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=b1eaba7a9b2d522f8948ca37a40a8c9c4af3a4b8;p=portage.git Moved EPREFIX check from late-die when installing a binary package to resolving phase, like the CHOST check. svn path=/main/branches/prefix/; revision=7885 --- diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 66c7c480c..33c587d53 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -1768,10 +1768,19 @@ class depgraph(object): # XXX: Need to work out how we use the binary tree with roots. usepkgonly = "--usepkgonly" in self.myopts chost = pkgsettings["CHOST"] + eprefix = pkgsettings["EPREFIX"] myeb_pkg_matches = [] for pkg in bindb.match(x): if chost != bindb.aux_get(pkg, ["CHOST"])[0]: continue + + pkg_eprefix = bindb.aux_get(pkg, ["EPREFIX"])[0] + if not pkg_eprefix: + continue + pkg_eprefix = pkg_eprefix.strip(); + if len(pkg_eprefix) < len(eprefix): + continue + # Remove any binary package entries that are # masked in the portage tree (#55871). if not usepkgonly and \ @@ -1928,11 +1937,17 @@ class depgraph(object): alleb = bindb.match(x) if alleb: chost = pkgsettings["CHOST"] + eprefix = pkgsettings["EPREFIX"] for p in alleb: mreasons = [] pkg_chost = bindb.aux_get(p, ["CHOST"])[0] if chost != pkg_chost: mreasons.append("CHOST: %s" % pkg_chost) + pkg_eprefix = bindb.aux_get(p, ["EPREFIX"])[0] + if not pkg_eprefix: + mreasons.append("missing EPREFIX") + elif len(pkg_eprefix.strip()) < len(eprefix): + mreasons.append("EPREFIX too small") print "- "+p+" (masked by: "+", ".join(mreasons)+")" print "!!! "+red("There are no packages available to satisfy: ")+green(xinfo) print "!!! Either add a suitable binary package or compile from an ebuild." diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 852f7f5f2..13fb4a094 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5169,15 +5169,11 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes mycat = mycat.strip() buildprefix = xptbz2.getfile("EPREFIX") - if not buildprefix: - writemsg("!!! EPREFIX info missing from info chunk, this is a non-prefix package, aborting...\n", + if not mycat: + writemsg("!!! EPREFIX info missing from info chunk, aborting...\n", noiselevel=-1) return 1 buildprefix = buildprefix.strip() - if len(buildprefix) < len(EPREFIX): - writemsg("!!! Unsuitable binary package, prefix absent or length is too small for this system\n", - noiselevel=-1) - return 1 # These are the same directories that would be used at build time. builddir = os.path.join( diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index e8e114fa4..9fcff61cd 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(["CHOST","SLOT"]) + self._aux_cache_keys = set(["CHOST","SLOT","EPREFIX"]) self._aux_cache = {} def match(self, *pargs, **kwargs):