aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-09-17 17:20:40 -0400
committerMike Frysinger <vapier@gentoo.org>2014-09-17 17:20:40 -0400
commit622535d24325820a5d042b16ebcd1a57b11cd802 (patch)
tree31b7d5c09caf54bc616142a0dfed021a2cdbcdde /wrappers/emerge-wrapper
parentcrossdev: set repo-name in generated layout.conf (diff)
downloadcrossdev-622535d24325820a5d042b16ebcd1a57b11cd802.tar.gz
crossdev-622535d24325820a5d042b16ebcd1a57b11cd802.tar.bz2
crossdev-622535d24325820a5d042b16ebcd1a57b11cd802.zip
switch from PORTDIR/PORTDIR_OVERLAY to repositories_configuration
URL: https://bugs.gentoo.org/520880 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'wrappers/emerge-wrapper')
-rwxr-xr-xwrappers/emerge-wrapper19
1 files changed, 17 insertions, 2 deletions
diff --git a/wrappers/emerge-wrapper b/wrappers/emerge-wrapper
index 7bcbcf0..154d82e 100755
--- a/wrappers/emerge-wrapper
+++ b/wrappers/emerge-wrapper
@@ -41,7 +41,7 @@ cross_wrap_etc()
# Re-use existing CHOST->portage ARCH mapping code
ARCH=$(
inherit() { :; }
- . "${PORTDIR}"/eclass/toolchain-funcs.eclass
+ . "${MAIN_REPO_PATH}"/eclass/toolchain-funcs.eclass
tc-arch
)
[[ ${ARCH} == "unknown" ]] && emit_setup_warning
@@ -109,10 +109,25 @@ cross_init()
# CBUILD must be the first thing we export, but might as well avoid
# running portageq multiple times ...
-import_vars="PORTDIR DISTDIR PORTDIR_OVERLAY MAKEOPTS GENTOO_MIRRORS"
+import_vars="DISTDIR MAKEOPTS GENTOO_MIRRORS"
eval $(portageq envvar -v CBUILD ${import_vars})
export CBUILD
+# Probably shouldn't hardcode "gentoo" here.
+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]) }
+')
+
# Get default CHOST value from program name
CHOST=${0##*/}
CHOST=${CHOST%-emerge}