public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/crossdev:master commit in: /, wrappers/
Date: Mon, 18 May 2015 15:55:51 +0000 (UTC)	[thread overview]
Message-ID: <1431964421.ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.vapier@gentoo> (raw)

commit:     ed6c54d9c660286fb1d0620e4c7f7ff00b642b57
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon May 18 15:52:12 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> 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 <vapier <AT> 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##*/}


             reply	other threads:[~2015-05-18 15:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 15:55 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-06-21 21:23 [gentoo-commits] proj/crossdev:master commit in: /, wrappers/ Sergei Trofimovich
2018-12-02 12:35 Sergei Trofimovich
2018-10-20 20:08 Sergei Trofimovich
2018-10-20 20:08 Sergei Trofimovich
2014-09-17 21:41 Mike Frysinger
2013-12-23  3:11 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431964421.ed6c54d9c660286fb1d0620e4c7f7ff00b642b57.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox