vapier      14/11/15 05:40:04

  Modified:             autotools.eclass
  Log:
  eautomake: fix parsing of version output #509786 by Brian Evans

Revision  Changes    Path
1.167                eclass/autotools.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?rev=1.167&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?rev=1.167&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools.eclass?r1=1.166&r2=1.167

Index: autotools.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- autotools.eclass    15 Nov 2014 05:10:47 -0000      1.166
+++ autotools.eclass    15 Nov 2014 05:40:04 -0000      1.167
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.166 2014/11/15 
05:10:47 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.167 2014/11/15 
05:40:04 vapier Exp $
 
 # @ECLASS: autotools.eclass
 # @MAINTAINER:
@@ -354,7 +354,8 @@
        done
 
        _automake_version() {
-               autotools_run_tool automake --version 2>/dev/null | sed -n -e 
'1{s:.*(GNU automake) ::p;q}'
+               autotools_run_tool --at-output automake --version 2>/dev/null |
+                       sed -n -e '1{s:.*(GNU automake) ::p;q}'
        }
 
        if [[ -z ${makefile_name} ]] ; then
@@ -369,8 +370,9 @@
                        sed -e 's:.*by automake \(.*\) from .*:\1:')
 
                if [[ ${installed_automake} != ${used_automake} ]]; then
-                       einfo "Automake used for the package (${used_automake}) 
differs from"
-                       einfo "the installed version (${installed_automake})."
+                       ewarn "Automake used for the package (${used_automake}) 
differs from" \
+                               "the installed version (${installed_automake})."
+                       ewarn "Forcing a full rebuild of the autotools to 
workaround."
                        eautoreconf
                        return 0
                fi
@@ -436,19 +438,20 @@
 }
 
 # @FUNCTION: autotools_run_tool
-# @USAGE: [--at-no-fail] [--at-m4flags] [--at-missing] <autotool> 
[tool-specific flags]
+# @USAGE: [--at-no-fail] [--at-m4flags] [--at-missing] [--at-output] 
<autotool> [tool-specific flags]
 # @INTERNAL
 # @DESCRIPTION:
 # Run the specified autotool helper, but do logging and error checking
 # around it in the process.
 autotools_run_tool() {
        # Process our own internal flags first
-       local autofail=true m4flags=false missing_ok=false
+       local autofail=true m4flags=false missing_ok=false return_output=false
        while [[ -n $1 ]] ; do
                case $1 in
                --at-no-fail) autofail=false;;
                --at-m4flags) m4flags=true;;
                --at-missing) missing_ok=true;;
+               --at-output)  return_output=true;;
                # whatever is left goes to the actual tool
                *) break;;
                esac
@@ -482,6 +485,12 @@
                set -- "${1}" $(autotools_m4dir_include) "${@:2}" 
$(autotools_m4sysdir_include)
        fi
 
+       # If the caller wants to probe something, then let them do it directly.
+       if ${return_output} ; then
+               "$@"
+               return
+       fi
+
        printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > 
"${STDERR_TARGET}"
 
        ebegin "Running $@"




Reply via email to