From: Mike Frysinger Date: Fri, 20 Mar 2015 18:22:05 +0000 (+0000) Subject: epatch: include `patch --version` output in the failure log X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e5af73c5a58f700efefbc48c4d883e74c6f43624;p=gentoo.git epatch: include `patch --version` output in the failure log --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 2214945b9b86..a291babd09a4 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.442 2015/01/14 22:50:02 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.443 2015/03/20 18:22:05 vapier Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -523,6 +523,10 @@ epatch() { einfo " ${patchname} ..." fi + # Handle aliased patch command #404447 #461568 + local patch="patch" + eval $(alias patch 2>/dev/null | sed 's:^alias ::') + # most of the time, there will only be one run per unique name, # but if there are more, make sure we get unique log filenames local STDERR_TARGET="${T}/${patchname}.out" @@ -530,7 +534,13 @@ epatch() { STDERR_TARGET="${T}/${patchname}-$$.out" fi - printf "***** %s *****\nPWD: %s\n\n" "${patchname}" "${PWD}" > "${STDERR_TARGET}" + printf "***** %s *****\nPWD: %s\nPATCH TOOL: %s -> %s\nVERSION INFO:\n%s\n\n" \ + "${patchname}" \ + "${PWD}" \ + "${patch}" \ + "$(type -P "${patch}")" \ + "$(${patch} --version)" \ + > "${STDERR_TARGET}" # Decompress the patch if need be local count=0 @@ -574,9 +584,6 @@ epatch() { # Dynamically detect the correct -p# ... i'm lazy, so shoot me :/ local patch_cmd - # Handle aliased patch command #404447 #461568 - local patch="patch" - eval $(alias patch 2>/dev/null | sed 's:^alias ::') while [[ ${count} -lt 5 ]] ; do patch_cmd="${patch} -p${count} ${EPATCH_OPTS}"