From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-426782-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RxOwD-0003q5-4c
	for garchives@archives.gentoo.org; Tue, 14 Feb 2012 20:25:21 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EDEF2E0AF6;
	Tue, 14 Feb 2012 20:24:53 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id AE480E0AEA
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Feb 2012 20:24:53 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 18F821B4025
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Feb 2012 20:24:53 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id DD928E540A
	for <gentoo-commits@lists.gentoo.org>; Tue, 14 Feb 2012 20:24:50 +0000 (UTC)
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org>
Message-ID: <1329251077.8a80fc4b1a1c155d47864d3559bfd4bbd31c0561.vapier@gentoo>
Subject: [gentoo-commits] proj/crossdev:master commit in: /
X-VCS-Repository: proj/crossdev
X-VCS-Files: crossdev
X-VCS-Directories: /
X-VCS-Committer: vapier
X-VCS-Committer-Name: Mike Frysinger
X-VCS-Revision: 8a80fc4b1a1c155d47864d3559bfd4bbd31c0561
X-VCS-Branch: master
Date: Tue, 14 Feb 2012 20:24:50 +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
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 8574041c-54a4-4a23-9f3b-9a52f45fe0f1
X-Archives-Hash: e1617e6baacf7bf066d8856d49a78d83

commit:     8a80fc4b1a1c155d47864d3559bfd4bbd31c0561
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 19:49:37 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 20:24:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;=
a=3Dcommit;h=3D8a80fc4b

crossdev: add --show-fail-log option

This way people can run in non-verbose mode by default, but have the full
failing log automatically dumped when things go wrong.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 crossdev |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/crossdev b/crossdev
index a9447f5..f51808f 100755
--- a/crossdev
+++ b/crossdev
@@ -37,6 +37,8 @@ Options:
     ${GOOD}--g, --gcc${NORMAL} ver           Specify version of gcc to u=
se
     ${GOOD}--k, --kernel${NORMAL} ver        Specify version of kernel h=
eaders to use
     ${GOOD}--l, --libc${NORMAL} ver          Specify version of libc to =
use
+                                Note: versions support depend atom synta=
xes:
+                                 e.g. ">=3D2.20" "~4.6.1" "=3D2.13.1-r3"
     ${GOOD}-A, --abis${NORMAL} abis          Specify ABIs to build, firs=
t one is the default
     ${GOOD}--[bdgkl]env${NORMAL} env         Specify env settings for bi=
nutils/gcc/gdb/kernel/libc
     ${GOOD}-f, --force${NORMAL}              I don't need a seat belt!
@@ -44,7 +46,7 @@ Options:
     ${GOOD}-C, --clean${NORMAL} target       Uninstall specified target
     ${GOOD}-P, --portage${NORMAL} opts       Options to pass to emerge (=
see emerge(1))
     ${GOOD}--with[out]-headers${NORMAL}      Build C library headers bef=
ore C compiler?
-Note: versions support depend atom syntaxes; e.g. ">=3D2.20" "~4.6.1" "=3D=
2.13.1-r3"
+    ${GOOD}--show-fail-log${NORMAL}          If the build fails, dump th=
e failing log
=20
 Overlay Options:
     ${GOOD}-oS, --overlays${NORMAL} list     Space delimited list of ove=
rlays to search
@@ -468,6 +470,7 @@ EX_GCC=3D"no"
 EX_GDB=3D"no"
 FORCE=3D"no"
 SET_X=3D"no"
+SHOW_FAIL_LOG=3D"no"
=20
 while [[ $# -gt 0 ]] ; do
 	case $1 in
@@ -502,6 +505,7 @@ while [[ $# -gt 0 ]] ; do
 	--without-*)       eval $(set_withval $1);;
 	-f|--force)        FORCE=3D"yes";;
 	-x)                SET_X=3D"yes";;
+	--show-fail-log)   SHOW_FAIL_LOG=3D"yes";;
 	-P|--portage)      UOPTS=3D"${UOPTS} $2"; shift;;
 	-b|-d|-p|-v|-q)    UOPTS=3D"${UOPTS} $1";;
 	-pv|-vp)           UOPTS=3D"${UOPTS} -p -v";;
@@ -868,6 +872,7 @@ doemerge() {
 	set_use $1 ${USE} $( [[ ${MULTILIB_USE} =3D=3D "no" ]] && echo - )multi=
lib
=20
 	if has -v ${UOPTS} || has -p ${UOPTS} || has -vp ${UOPTS} || has -pv ${=
UOPTS} ; then
+		SHOW_FAIL_LOG=3D"no"
 		emerge cross-${CTARGET}/$1 ${EOPTS} \
 			2>&1 | tee "${logfile}"
 	else
@@ -875,7 +880,10 @@ doemerge() {
 			>& "${logfile}"
 	fi
 	local _pipestatus=3D${PIPESTATUS[*]}
-	[[ "${_pipestatus// /}" -eq 0 ]] || die "$1 failed :("
+	if [[ "${_pipestatus// /}" -ne 0 ]] ; then
+		[[ ${SHOW_FAIL_LOG} =3D=3D "yes" ]] && cat "${logfile}"
+		die "$1 failed :("
+	fi
 	eend 0
 }
=20