From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7D262138CD0 for ; Mon, 18 May 2015 15:55:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0CB5E0869; Mon, 18 May 2015 15:55:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 98B8EE0869 for ; Mon, 18 May 2015 15:55:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8EB97340B3F for ; Mon, 18 May 2015 15:55:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 76EA19E2 for ; Mon, 18 May 2015 15:55:51 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1431964421.ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.vapier@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: /, wrappers/ X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev wrappers/emerge-wrapper X-VCS-Directories: wrappers/ / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: ed6c54d9c660286fb1d0620e4c7f7ff00b642b57 X-VCS-Branch: master Date: Mon, 18 May 2015 15:55:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 10391f86-ca30-4a1e-883e-a6d3b30c1c9d X-Archives-Hash: e62f9260e308df55b0595feb51986261 commit: ed6c54d9c660286fb1d0620e4c7f7ff00b642b57 Author: Mike Frysinger gentoo org> AuthorDate: Mon May 18 15:52:12 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon May 18 15:53:41 2015 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=ed6c54d9 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 gentoo.org> crossdev | 10 ++++++++++ wrappers/emerge-wrapper | 15 +-------------- 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##*/}