From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1295837-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 66CB31382C5
	for <garchives@archives.gentoo.org>; Mon, 21 Jun 2021 21:23:27 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 57C93E0878;
	Mon, 21 Jun 2021 21:23:26 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 38928E0878
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Jun 2021 21:23:26 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 5554433D3CF
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Jun 2021 21:23:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E0C157B5
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Jun 2021 21:23:23 +0000 (UTC)
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" <slyfox@gentoo.org>
Message-ID: <1624300948.0f2a105de5c407a2fa0113d0815d54e0067bbb4b.slyfox@gentoo>
Subject: [gentoo-commits] proj/crossdev:master commit in: /
X-VCS-Repository: proj/crossdev
X-VCS-Files: crossdev
X-VCS-Directories: /
X-VCS-Committer: slyfox
X-VCS-Committer-Name: Sergei Trofimovich
X-VCS-Revision: 0f2a105de5c407a2fa0113d0815d54e0067bbb4b
X-VCS-Branch: master
Date: Mon, 21 Jun 2021 21:23:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 02b4bb95-9b3c-4142-874f-d6dad1159413
X-Archives-Hash: b28b5039a91a6ea14e0cc988ea995e5f

commit:     0f2a105de5c407a2fa0113d0815d54e0067bbb4b
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 21 18:42:28 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Jun 21 18:42:28 2021 +0000
URL:        https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=0f2a105d

crossdev: fail eval when multilib.eclass sourcing fails

Before the change failure to source 'multilib.eclass' resuled in
a fallback mode to be used instead of hard failure.

It was caused by two expansion layers of 'eval $(...)'.

After the change falure to source 'mmultilib.eclass' hard fails early:

```
$ PORTAGE_CONFIGROOT=$(pwd)/foo EPREFIX=$(pwd)/foo PORT_LOGDIR=$(pwd)/foo ./crossdev -t mmix -P -p
 * error: : EAPI 0 not supported
 *
 * If you file a bug, please attach the following logfiles:
 * /home/slyfox/dev/git/crossdev/foo/cross--info.log
 *
 * error: could not load multilib settings for 'HCHOST'
 *
 * If you file a bug, please attach the following logfiles:
 * /home/slyfox/dev/git/crossdev/foo/cross-mmix-info.log
```

Reported-by: Marco Scardovi (scardracs)
Bug: https://bugs.gentoo.org/797367
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 crossdev | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/crossdev b/crossdev
index 1a2b030..619603f 100755
--- a/crossdev
+++ b/crossdev
@@ -968,6 +968,9 @@ fi
 # parse multilib settings until profiles are sane
 load_multilib_env() {
 	local var=$1
+	# TODO: avoid eval+subshell and use subshell only. It will make error
+	# handling simpler.
+	local eval_result=failed
 	eval $(
 	# see what target to parse
 	CTARGET=${!var}
@@ -1016,7 +1019,9 @@ load_multilib_env() {
 			echo ${_v}=\'${!d}\'
 		done
 	done
+	echo "eval_result='succeeded'"
 	)
+	[[ $eval_result = succeeded ]] || die "could not load multilib settings for '${var}'"
 }
 # Load settings for the host.
 MULTILIB_ABIS=${HOST_ABI} load_multilib_env HCHOST