Moved EPREFIX check from late-die when installing a binary package to
authorFabian Groffen <grobian@gentoo.org>
Sat, 29 Sep 2007 20:47:55 +0000 (20:47 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 29 Sep 2007 20:47:55 +0000 (20:47 -0000)
resolving phase, like the CHOST check.

svn path=/main/branches/prefix/; revision=7885

pym/emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/bintree.py

index 66c7c480cf48b9e201e00b619ae081c354c1ec0a..33c587d53778c728cfbb653433084483c1d1f6bc 100644 (file)
@@ -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."
index 852f7f5f248c2ed0e73e3a3b257b9f72b6095367..13fb4a094bbb6ad13b4e94499e9b6df2483bfb46 100644 (file)
@@ -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(
index e8e114fa4173a88d5efafd689766745b280def30..9fcff61cd92f57b7b0188ae8085fee87ace31fab 100644 (file)
@@ -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):