From: Stefano Lattarini Date: Tue, 15 Feb 2011 11:45:28 +0000 (+0100) Subject: test defs: add subroutine for input unindenting X-Git-Tag: ng-0.5a~231^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a118732d1138b169e3c41759b8e3e03945994172;p=thirdparty%2Fautomake.git test defs: add subroutine for input unindenting * tests/defs.in (unindent): New subroutine. --- diff --git a/ChangeLog b/ChangeLog index fa53707fe..4563585da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-02-16 Stefano Lattarini + Ralf Wildenhues + + test defs: add subroutine for input unindenting + * tests/defs.in (unindent): New subroutine. + 2011-02-15 Stefano Lattarini python: report the 'PYTHON' influential environment variable diff --git a/tests/defs.in b/tests/defs.in index eb92caa84..ffe21e1de 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -440,6 +440,24 @@ AUTOMAKE_fails () AUTOMAKE_run 1 ${1+"$@"} } +# unindent [input files...] +# ------------------------- +# Remove the "proper" amount of leading whitespace from the given files, +# and output the result on stdout. That amount is determined by looking +# at the leading whitespace of the first non-blank line in the input +# files. If no input file is specified, standard input is implied. +unindent () +{ + cat ${1+"$@"} > deindent.tmp + indentation=`sed