aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-18 11:52:12 -0400
committerMike Frysinger <vapier@gentoo.org>2015-05-18 11:53:41 -0400
commited6c54d9c660286fb1d0620e4c7f7ff00b642b57 (patch)
tree40a3d26c6befb0664143cd30c1fc9f28e43cf785
parentcrossdev: switch nios to mainline packages (diff)
downloadcrossdev-ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.tar.gz
crossdev-ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.tar.bz2
crossdev-ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.zip
crossdev/emerge-wrapper: merge repos.conf parsers
The crossdev code had a more full-featured parser of the repos.conf output than the emerge-wrapper. The latter failed to include the last overlay in the list leading to ugly warnings like: /usr/bin/emerge-wrapper: line 48: /eclass/toolchain-funcs.eclass: No such file or directory /usr/bin/emerge-wrapper: line 49: tc-arch: command not found URL: https://bugs.gentoo.org/546748 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xcrossdev10
-rwxr-xr-xwrappers/emerge-wrapper15
2 files changed, 11 insertions, 14 deletions
diff --git a/crossdev b/crossdev
index 62b6c3d..0691641 100755
--- a/crossdev
+++ b/crossdev
@@ -351,6 +351,15 @@ parse_repo_config() {
fi
}
+# Used by --show-repo-cfg to share the parser logic with other tools.
+show_repo_cfg() {
+ local var=$1
+ unset SEARCH_OVERLAYS
+ parse_repo_config
+ echo "${!var}"
+ exit 0
+}
+
setup_portage_vars() {
local arch=${ARCH} arch_set=${ARCH+set}
local chost=${CHOST} chost_set=${CHOST+set}
@@ -602,6 +611,7 @@ while [[ $# -gt 0 ]] ; do
--show-target-cfg) SHOW_TARGET_CFG="yes";;
--init-target) INIT_TARGET_ONLY="yes";;
--show-fail-log) SHOW_FAIL_LOG="yes";;
+ --show-repo-cfg) show_repo_cfg "$2";;
-P|--portage) UOPTS="${UOPTS} $2"; shift;;
-b|-d|-p|-v|-q) UOPTS="${UOPTS} $1";;
-pv|-vp) UOPTS="${UOPTS} -p -v";;
diff --git a/wrappers/emerge-wrapper b/wrappers/emerge-wrapper
index 4056601..e375025 100755
--- a/wrappers/emerge-wrapper
+++ b/wrappers/emerge-wrapper
@@ -116,20 +116,7 @@ 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]) }
-')
+MAIN_REPO_PATH=$(crossdev --show-repo-cfg MAIN_REPO_PATH)
# Get default CHOST value from program name
CHOST=${0##*/}