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 ) id 1S2nAf-000339-F1 for garchives@archives.gentoo.org; Wed, 29 Feb 2012 17:18:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F443E0897; Wed, 29 Feb 2012 17:18:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D3A59E0897 for ; Wed, 29 Feb 2012 17:18:24 +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 177141B4011 for ; Wed, 29 Feb 2012 17:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id CC52CE53FE for ; Wed, 29 Feb 2012 17:18:22 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1330535471.c770bea7dfb34a39f305407e8126f3536e6ce6af.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: c770bea7dfb34a39f305407e8126f3536e6ce6af X-VCS-Branch: master Date: Wed, 29 Feb 2012 17:18:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 2aa70429-77e1-4705-8b60-70d143720375 X-Archives-Hash: dae77850134dddca8e772f7d65b2bab5 commit: c770bea7dfb34a39f305407e8126f3536e6ce6af Author: Mike Frysinger gentoo org> AuthorDate: Wed Feb 29 16:43:54 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Wed Feb 29 17:11:11 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;= a=3Dcommit;h=3Dc770bea7 crossdev: tell users what to post when a build fails Include all the log files and such. Signed-off-by: Mike Frysinger gentoo.org> --- crossdev | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 39 insertions(+), 16 deletions(-) diff --git a/crossdev b/crossdev index 14515ca..65bd433 100755 --- a/crossdev +++ b/crossdev @@ -16,14 +16,21 @@ CONFIGROOT=3D"${PORTAGE_CONFIGROOT}/etc/portage" =20 source /etc/init.d/functions.sh || exit 1 esyslog() { :; } -die() { +die_logs() { echo - eerror $* - eerror If you file a bug, please attach the following logfiles: - eerror ${PORT_LOGDIR}/cross-${CTARGET}-info.log - eerror ${logfile} + eerror "$1" + + shift + local log + eerror + eerror "If you file a bug, please attach the following logfiles:" + eerror "${PORT_LOGDIR}/cross-${CTARGET}-info.log" + for log in "$@" ; do + eerror "${log}" + done exit 1 } +die() { die_logs "$*"; } has() { [[ " ${@:2} " =3D=3D *" $1 "* ]]; } =20 usage() { @@ -274,7 +281,7 @@ setup_portage_vars() { local arch=3D${ARCH} arch_set=3D${ARCH+set} local chost=3D${CHOST} chost_set=3D${CHOST+set} unset arch chost - eval $(portageq envvar -v PORTDIR_OVERLAY PORTDIR PORT_LOGDIR ARCH CHOS= T) + eval $(portageq envvar -v PORTDIR_OVERLAY PORTDIR PORT_LOGDIR PORTAGE_T= MPDIR ARCH CHOST) =20 # keep the original values, but be aware of the native ones HARCH=3D${ARCH} @@ -928,30 +935,46 @@ set_eopts_on_pkg_status() { || EOPTS=3D${EOPTS_UP} } doemerge() { - [[ $1 =3D=3D "[none]" ]] && return 0 + local category=3D"cross-${CTARGET}" + local pn=3D$1 + local atom=3D"${category}/${pn}" + + [[ ${pn} =3D=3D "[none]" ]] && return 0 =20 - local logfile=3D${PORT_LOGDIR}/cross-${CTARGET} + local logfile=3D${PORT_LOGDIR}/${category} [[ -z $2 ]] \ - && logfile=3D${logfile}-$1.log \ + && logfile=3D${logfile}-${pn}.log \ || logfile=3D${logfile}-$2.log =20 einfo "Log: ${logfile}" - ebegin "Emerging cross-${2:-$1}" + ebegin "Emerging cross-${2:-${pn}}" =20 - set_use $1 ${USE} $( [[ ${MULTILIB_USE} =3D=3D "no" ]] && echo - )multi= lib + set_use ${pn} ${USE} $( [[ ${MULTILIB_USE} =3D=3D "no" ]] && echo - )mu= ltilib =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}" + emerge ${atom} ${EOPTS} 2>&1 | tee "${logfile}" else - emerge cross-${CTARGET}/$1 ${EOPTS} \ - >& "${logfile}" + emerge ${atom} ${EOPTS} >& "${logfile}" fi local _pipestatus=3D${PIPESTATUS[*]} if [[ "${_pipestatus// /}" -ne 0 ]] ; then [[ ${SHOW_FAIL_LOG} =3D=3D "yes" ]] && cat "${logfile}" - die "$1 failed :(" + + local d + for d in "${PORTAGE_TMPDIR}"/portage/${atom}*/work/ ; do + pushd "${d}" >/dev/null + mkdir -p ../temp # sanity! + find -name config.log | \ + tar cf - --files-from=3D- | \ + xz > ../temp/${pn}-config.logs.tar.xz + popd "${d}" >/dev/null + done + xz -zk "${logfile}" + + die_logs "${pn} failed :(" \ + "${logfile}.xz" \ + "${PORTAGE_TMPDIR}/portage/${atom}*/temp/${pn}-config.logs.tar.xz" fi eend 0 }