commit:     9836a593874dd3459c8ec1035635ede29d3afbfa
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 27 08:52:49 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jun 27 08:52:49 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9836a593

main: default main_overlay to first overlay

If no overlay was explicitly marked as MAIN, assume the first to be, if
any were set.  Else the builtin default location is used.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/main.c b/main.c
index fd4a60b..c5cc4b4 100644
--- a/main.c
+++ b/main.c
@@ -749,6 +749,9 @@ initialize_portage_env(void)
        if (array_cnt(overlays) == 0) {
                xarraypush_ptr(overlays, main_overlay);
                xarraypush_str(overlay_names, "<PORTDIR>");
+       } else if (orig_main_overlay == main_overlay) {
+               /* if no explicit overlay was flagged as main, take the first 
one */
+               main_overlay = array_get_elem(overlays, 0);
        }
 
        if (getenv("DEBUG")) {

Reply via email to