ebuild(1): avoid "Location not set for repo" msgs
authorZac Medico <zmedico@gentoo.org>
Tue, 13 Sep 2011 04:56:48 +0000 (21:56 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 13 Sep 2011 04:56:48 +0000 (21:56 -0700)
When overriding PORTDIR_OVERLAY, we can avoid "Location not set for
repository" messages if we include the original PORTDIR_OVERLAY paths
in the overridden setting.

bin/ebuild

index 92105bbbd988ddd2a4ebae2b70a40cca58ab601d..1408dd32ed38fa2bde5608a32cd0fa90122dfffc 100755 (executable)
@@ -134,13 +134,19 @@ vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
 # Make sure that portdb.findname() returns the correct ebuild.
 if ebuild_portdir != vdb_path and \
        ebuild_portdir not in portage.portdb.porttrees:
+       portdir_overlay = os.environ.get("PORTDIR_OVERLAY")
+       if portdir_overlay is None:
+               portdir_overlay = portage.settings.get("PORTDIR_OVERLAY")
+       if portdir_overlay is None:
+               portdir_overlay = ""
        if sys.hexversion >= 0x3000000:
                os.environ["PORTDIR_OVERLAY"] = \
-                       os.environ.get("PORTDIR_OVERLAY","") + \
+                       portdir_overlay + \
                        " " + _shell_quote(ebuild_portdir)
        else:
                os.environ["PORTDIR_OVERLAY"] = \
-                       os.environ.get("PORTDIR_OVERLAY","") + \
+                       _unicode_encode(portdir_overlay,
+                       encoding=_encodings['content'], errors='strict') + \
                        " " + _unicode_encode(_shell_quote(ebuild_portdir),
                        encoding=_encodings['content'], errors='strict')