Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528542 - sys-devel/crossdev-20140917 creates invalid make.conf
Summary: sys-devel/crossdev-20140917 creates invalid make.conf
Status: RESOLVED DUPLICATE of bug 546748
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-11-07 09:05 UTC by Florian Kluge
Modified: 2015-05-18 16:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for emerge-wrapper (emerge-wrapper.patch,381 bytes, patch)
2014-11-07 09:05 UTC, Florian Kluge
Details | Diff
emerge --info (einfo,5.26 KB, text/plain)
2014-11-07 09:10 UTC, Florian Kluge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Kluge 2014-11-07 09:05:26 UTC
Created attachment 388742 [details, diff]
patch for emerge-wrapper

I tried to create an arm-none-eabi cross toolchain on my netbook. While this worked on my PCs, there are some issues on the netbook. There, I noticed that the /usr/arm-none-eabi/etc/portage/make.conf contained at least one problematic setting, e.g. ACCEPT_KEYWORDS=" ~ ". I could trace this problem to the emerge-wrapper script where the variable MAIN_REPO_PATH is determined:

MAIN_REPO_PATH=$(portageq repositories_configuration / | gawk '
        {
                if ($1 == "main-repo") {
                        main_repo = $NF
                } else if ($1 ~ /^\[/) {
                        locs[repo_name] = loc
                        repo_name = gensub(/\[([^\]]*)\]/, "\\1", "", $1)
                } else if ($1 == "location") {
                        loc = $3
                }
        }
        END { print(locs[main_repo]) }
')


On the netbook, portageq outputs:

[DEFAULT]
main-repo = gentoo

[crossdev]
location = /usr/local/portage
masters = gentoo
priority = 0

[gentoo]
location = /usr/portage
masters = 
priority = -1000
sync-type = rsync
sync-uri = rsync://rsync.europe.gentoo.org/gentoo-portage


As the [gentoo] section comes last in this output, gawk fails to store its location, which finally somehow leads to the strange ACCEPT_KEYWORDS variable. Storing the loc variable at the end of the script fixes the problem (see attached patch).
Comment 1 Florian Kluge 2014-11-07 09:10:51 UTC
Created attachment 388744 [details]
emerge --info
Comment 2 Michael Haubenwallner (RETIRED) gentoo-dev 2015-02-16 16:04:26 UTC
For a probably more straightforward patch:

--- a/wrappers/emerge-wrapper
+++ b/wrappers/emerge-wrapper
@@ -122,10 +122,9 @@ MAIN_REPO_PATH=$(portageq repositories_configuration / | gawk '
                if ($1 == "main-repo") {
                        main_repo = $NF
                } else if ($1 ~ /^\[/) {
-                       locs[repo_name] = loc
                        repo_name = gensub(/\[([^\]]*)\]/, "\\1", "", $1)
                } else if ($1 == "location") {
-                       loc = $3
+                       locs[repo_name] = $3
                }
        }
        END { print(locs[main_repo]) }
Comment 3 SpanKY gentoo-dev 2015-05-18 16:41:46 UTC
normally we'd dupe newer reports to older, but i already fixed & pushed a commit referencing the new bug, so oh well

*** This bug has been marked as a duplicate of bug 546748 ***