epatch: include `patch --version` output in the failure log
authorMike Frysinger <vapier@gentoo.org>
Fri, 20 Mar 2015 18:22:05 +0000 (18:22 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 20 Mar 2015 18:22:05 +0000 (18:22 +0000)
eclass/eutils.eclass

index 2214945b9b86f6ef0b3df4db9e5e33df056109df..a291babd09a418124cbb89351b5ffc03df94fad2 100644 (file)
@@ -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}"