I am feeling pretty good as the introduction of the newline to the printf
does not fundamentally change much about the updated processing. My main
concern was if that additional newline was going to make it into the final
arguments as extra text. This does not seem to be the case on mac or
ubuntu, so I guess sed must always eat the last newline when piped in this
manner.
I think the most important takaway from the 1.9.7 release are the quoting
of the final eval, the padding the argument before escaping to support
empty and whitespace, and the newline for the sed input on Solaris.

Not sure if attachments would go through mailing list so I'll just copy and
paste inline as they are short.

My ant file is test.xml. Used to echo's a bunch of input properties. The
trailing _ is to delimit the value to make it readable and prevent ant echo
from trimming the output:

<project default="run">
    <target name="run">
        <echo message="hello world"/>
        <echo message="foo=${foo}_"/>
        <echo message="bar=${bar}_"/>
        <echo message="nl=${nl}_"/>
        <echo message="nlnl=${nlnl}_"/>
        <echo message="nlnlnl=${nlnlnl}_"/>
        <echo message="doublespace=${doublespace}_"/>
        <echo message="end"/>
    </target>
</project>

My test.sh passes a variety of characters as the properties to be echoed.
Includes literals that use an unballanced single-quote, double-quote,
backtick, dollar, backslash (trailing on value). Also properties with 1, 2,
and 3 consecutive trailing newline literals to see if they come through
accurately. The execdebug flag shows each original argument and the
quoted/escaped form of the argument used within eval.

=========================
#!/bin/sh

ant >/dev/null || exit 1

# literal newline char
NL="
"

./dist/bin/ant --execdebug \
  "-Dfoo=dollar\$_backtick\`_single'_double\"_trailingbackslash\\" \
  "-Dbar=trailingnewline$NL" \
  "-Dnl=$NL" \
  "-Dnlnl=$NL$NL" \
  "-Dnlnlnl=$NL$NL$NL" \
  "-Ddoublespace=  " \
  "-Dx=y" \
  "-f" "test.xml"
=========================

Expected output is:

Buildfile: /home/jwa/Developer/projects/apache/ant/test.xml

run:
     [echo] hello world
     [echo] foo=dollar$_backtick`_single'_double"_trailingbackslash\_
     [echo] bar=trailingnewline
     [echo] _
     [echo] nl=
     [echo] _
     [echo] nlnl=
     [echo]
     [echo] _
     [echo] nlnlnl=
     [echo]
     [echo]
     [echo] _
     [echo] doublespace=  _
     [echo] end



Regards,
Jeff Adamson

Johan Corveleyn <jcor...@gmail.com> wrote on 10/26/2016 06:53:18 AM:

> From: Johan Corveleyn <jcor...@gmail.com>
> To: Ant Developers List <dev@ant.apache.org>
> Cc: maarten_co...@yahoo.com
> Date: 10/26/2016 06:53 AM
> Subject: Re: ant wrapper script testing
>
> On Tue, Oct 25, 2016 at 9:29 PM, Jeff Adamson <jwadam...@us.ibm.com>
wrote:
> >
> > Oops, had the nawk check inverted.
> >
> > should have been https://github.com/jwadamson/ant-1/commit/
> c1ac08abcaad0030064d62933dda278b5326f92b
> >
>
> Great, it works on Solaris 11, both with 'sed' and 'awk' as
> esc_tool. Nice job!
>
> Now, I only tested 'ant -version'. I've actually not been following
> the original discussion that lead to all the changes in the wrapper
> script (I only noticed that 1.9.7 was broken on Solaris for simple
> inputs). Are there some specific inputs you would like me to test on
> Solaris? Or is there perhaps some automatic test I can run for
> exercising the various inputs to the script?
>
> --
> Johan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
> For additional commands, e-mail: dev-h...@ant.apache.org
>

Reply via email to