For ebuilds from $ROOT/var/db/pkg, don't give /var/db/pkg with the
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 04:52:31 +0000 (21:52 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Aug 2010 04:52:31 +0000 (21:52 -0700)
"Appending /var/db/pkg to PORTDIR_OVERLAY..." treatment.

bin/ebuild

index 617cad355eff187e26a519f080f5f3ae6fb6bd60..658652f5ae6a39d041e0d2c54d52ccfee07571e1 100755 (executable)
@@ -74,6 +74,7 @@ from portage import _encodings
 from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
+from portage.const import VDB_PATH
 
 if not opts.ignore_default_opts:
        default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split()
@@ -129,9 +130,11 @@ ebuild = portage.normalize_path(ebuild)
 ebuild_portdir = os.path.realpath(
        os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
 ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
+vdb_path = os.path.join(portage.settings['ROOT'], VDB_PATH)
 
 # Make sure that portdb.findname() returns the correct ebuild.
-if ebuild_portdir not in portage.portdb.porttrees:
+if ebuild_portdir != vdb_path and \
+       ebuild_portdir not in portage.portdb.porttrees:
        if sys.hexversion >= 0x3000000:
                os.environ["PORTDIR_OVERLAY"] = \
                        os.environ.get("PORTDIR_OVERLAY","") + \