You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Colin Sampaleanu <co...@exis.com> on 2004/01/06 18:23:17 UTC
Did 1.6 break old filter behaviour?
I have a filter set as follows:
<property name="email.from" value="admin-dev@something.com"/>
...
<filter token="EMAIL_FROM" value="${email.from}" />
this worked fine in ant 1.5, for replacing this filter value in a file
with multiple @EMAIL_FROM@ tokens in it, via a copy task with filter="on"
With ant 1.6, I now get this behaviour:
[copy] Copying 1 file to
D:\src\something\cvs\core\core-services\target\classes
[copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
[copy] Inifinite loop in tokens. Currently known tokens : [EMAIL_FROM]
[copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
[copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
... and so on
Now obviously the @ sign in the email address is confusing the token
processor, and it works fine if I replace it with another value, but
this worked fine in ant 1.5!
Can anybody confirm if this is a bug?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Did 1.6 break old filter behaviour?
Posted by Peter Reilly <pe...@corvil.com>.
I have found the cause of the error.
This will be fixed in ant 1.6.1.
Peter
Colin Sampaleanu wrote:
> That solution doesn't work too well, since I was relying on global
> filters for copying in several places, and don't want to redefine them
> each time. However, I was also already using
> <filterchain>
> <expandproperties/>
> </filterchain>
> in the copy tasks, so until this is fixed I am doing something like
> this to define the filter/prop to replace:
> <!-- broken, use property instead -->
> <!--filter token="EMAIL_FROM" value="${email.from}" /-->
> <property name="EMAIL_FROM" value="${email.from}" />
>
> and in my source file I have replaced all @EMAIL_FROM@ occurences to
> ${EMAIL_FROM}
>
> Regards,
> Colin
>
>
> Peter Reilly wrote:
>
>> Until it gets fixed, you could use a filterchain with replacestring
>> instead:
>>
>> <target name="chain">
>> <delete quiet="yes" file="filter.out"/>
>> <copy file="filter.inp" tofile="filter.out">
>> <filterchain>
>> <replacestring from="@EMAIL_FROM@" to="admin-dev@something.com"/>
>> </filterchain>
>> </copy>
>> </target>
>>
>> Peter
>>
>> Colin Sampaleanu wrote:
>>
>>> Bummer, this is pretty nasty...
>>>
>>> Peter Reilly wrote:
>>>
>>>> This looks like the same problem as
>>>>
>>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
>>>> which we have not been able to reproduce.
>>>>
>>>> With an input file: filter.inp
>>>> @EMAIL_FROM@ token
>>>> @EMAIL_FROM@ token
>>>>
>>>> and a build file:
>>>>
>>>> <project>
>>>> <property name="email.from" value="admin-dev@something.com"/>
>>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>>> <delete quiet="yes" file="filter.out"/>
>>>> <copy file="filter.inp" tofile="filter.out" filtering="yes"/>
>>>> </project>
>>>>
>>>> the problem can be reproduced.
>>>>
>>>> Peter
>>>>
>>>> Colin Sampaleanu wrote:
>>>>
>>>>> I have a filter set as follows:
>>>>>
>>>>> <property name="email.from" value="admin-dev@something.com"/>
>>>>> ...
>>>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>>>>
>>>>> this worked fine in ant 1.5, for replacing this filter value in a
>>>>> file with multiple @EMAIL_FROM@ tokens in it, via a copy task with
>>>>> filter="on"
>>>>>
>>>>> With ant 1.6, I now get this behaviour:
>>>>> [copy] Copying 1 file to
>>>>> D:\src\something\cvs\core\core-services\target\classes
>>>>> [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
>>>>> [copy] Inifinite loop in tokens. Currently known tokens :
>>>>> [EMAIL_FROM]
>>>>> [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>>> ... and so on
>>>>>
>>>>> Now obviously the @ sign in the email address is confusing the
>>>>> token processor, and it works fine if I replace it with another
>>>>> value, but this worked fine in ant 1.5!
>>>>>
>>>>> Can anybody confirm if this is a bug?
>>>>
>>>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Did 1.6 break old filter behaviour?
Posted by Colin Sampaleanu <co...@exis.com>.
That solution doesn't work too well, since I was relying on global
filters for copying in several places, and don't want to redefine them
each time. However, I was also already using
<filterchain>
<expandproperties/>
</filterchain>
in the copy tasks, so until this is fixed I am doing something like this
to define the filter/prop to replace:
<!-- broken, use property instead -->
<!--filter token="EMAIL_FROM" value="${email.from}" /-->
<property name="EMAIL_FROM" value="${email.from}" />
and in my source file I have replaced all @EMAIL_FROM@ occurences to
${EMAIL_FROM}
Regards,
Colin
Peter Reilly wrote:
> Until it gets fixed, you could use a filterchain with replacestring
> instead:
>
> <target name="chain">
> <delete quiet="yes" file="filter.out"/>
> <copy file="filter.inp" tofile="filter.out">
> <filterchain>
> <replacestring from="@EMAIL_FROM@" to="admin-dev@something.com"/>
> </filterchain>
> </copy>
> </target>
>
> Peter
>
> Colin Sampaleanu wrote:
>
>> Bummer, this is pretty nasty...
>>
>> Peter Reilly wrote:
>>
>>> This looks like the same problem as
>>>
>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
>>> which we have not been able to reproduce.
>>>
>>> With an input file: filter.inp
>>> @EMAIL_FROM@ token
>>> @EMAIL_FROM@ token
>>>
>>> and a build file:
>>>
>>> <project>
>>> <property name="email.from" value="admin-dev@something.com"/>
>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>> <delete quiet="yes" file="filter.out"/>
>>> <copy file="filter.inp" tofile="filter.out" filtering="yes"/>
>>> </project>
>>>
>>> the problem can be reproduced.
>>>
>>> Peter
>>>
>>> Colin Sampaleanu wrote:
>>>
>>>> I have a filter set as follows:
>>>>
>>>> <property name="email.from" value="admin-dev@something.com"/>
>>>> ...
>>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>>>
>>>> this worked fine in ant 1.5, for replacing this filter value in a
>>>> file with multiple @EMAIL_FROM@ tokens in it, via a copy task with
>>>> filter="on"
>>>>
>>>> With ant 1.6, I now get this behaviour:
>>>> [copy] Copying 1 file to
>>>> D:\src\something\cvs\core\core-services\target\classes
>>>> [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
>>>> [copy] Inifinite loop in tokens. Currently known tokens :
>>>> [EMAIL_FROM]
>>>> [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>>> ... and so on
>>>>
>>>> Now obviously the @ sign in the email address is confusing the
>>>> token processor, and it works fine if I replace it with another
>>>> value, but this worked fine in ant 1.5!
>>>>
>>>> Can anybody confirm if this is a bug?
>>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Did 1.6 break old filter behaviour?
Posted by Peter Reilly <pe...@corvil.com>.
Until it gets fixed, you could use a filterchain with replacestring instead:
<target name="chain">
<delete quiet="yes" file="filter.out"/>
<copy file="filter.inp" tofile="filter.out">
<filterchain>
<replacestring from="@EMAIL_FROM@" to="admin-dev@something.com"/>
</filterchain>
</copy>
</target>
Peter
Colin Sampaleanu wrote:
> Bummer, this is pretty nasty...
>
> Peter Reilly wrote:
>
>> This looks like the same problem as
>>
>> http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
>> which we have not been able to reproduce.
>>
>> With an input file: filter.inp
>> @EMAIL_FROM@ token
>> @EMAIL_FROM@ token
>>
>> and a build file:
>>
>> <project>
>> <property name="email.from" value="admin-dev@something.com"/>
>> <filter token="EMAIL_FROM" value="${email.from}" />
>> <delete quiet="yes" file="filter.out"/>
>> <copy file="filter.inp" tofile="filter.out" filtering="yes"/>
>> </project>
>>
>> the problem can be reproduced.
>>
>> Peter
>>
>> Colin Sampaleanu wrote:
>>
>>> I have a filter set as follows:
>>>
>>> <property name="email.from" value="admin-dev@something.com"/>
>>> ...
>>> <filter token="EMAIL_FROM" value="${email.from}" />
>>>
>>> this worked fine in ant 1.5, for replacing this filter value in a
>>> file with multiple @EMAIL_FROM@ tokens in it, via a copy task with
>>> filter="on"
>>>
>>> With ant 1.6, I now get this behaviour:
>>> [copy] Copying 1 file to
>>> D:\src\something\cvs\core\core-services\target\classes
>>> [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
>>> [copy] Inifinite loop in tokens. Currently known tokens :
>>> [EMAIL_FROM]
>>> [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>>> ... and so on
>>>
>>> Now obviously the @ sign in the email address is confusing the token
>>> processor, and it works fine if I replace it with another value, but
>>> this worked fine in ant 1.5!
>>>
>>> Can anybody confirm if this is a bug?
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Did 1.6 break old filter behaviour?
Posted by Colin Sampaleanu <co...@exis.com>.
Bummer, this is pretty nasty...
Peter Reilly wrote:
> This looks like the same problem as
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
> which we have not been able to reproduce.
>
> With an input file: filter.inp
> @EMAIL_FROM@ token
> @EMAIL_FROM@ token
>
> and a build file:
>
> <project>
> <property name="email.from" value="admin-dev@something.com"/>
> <filter token="EMAIL_FROM" value="${email.from}" />
> <delete quiet="yes" file="filter.out"/>
> <copy file="filter.inp" tofile="filter.out" filtering="yes"/>
> </project>
>
> the problem can be reproduced.
>
> Peter
>
> Colin Sampaleanu wrote:
>
>> I have a filter set as follows:
>>
>> <property name="email.from" value="admin-dev@something.com"/>
>> ...
>> <filter token="EMAIL_FROM" value="${email.from}" />
>>
>> this worked fine in ant 1.5, for replacing this filter value in a
>> file with multiple @EMAIL_FROM@ tokens in it, via a copy task with
>> filter="on"
>>
>> With ant 1.6, I now get this behaviour:
>> [copy] Copying 1 file to
>> D:\src\something\cvs\core\core-services\target\classes
>> [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
>> [copy] Inifinite loop in tokens. Currently known tokens :
>> [EMAIL_FROM]
>> [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
>> ... and so on
>>
>> Now obviously the @ sign in the email address is confusing the token
>> processor, and it works fine if I replace it with another value, but
>> this worked fine in ant 1.5!
>>
>> Can anybody confirm if this is a bug?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Did 1.6 break old filter behaviour?
Posted by Peter Reilly <pe...@corvil.com>.
This looks like the same problem as
http://issues.apache.org/bugzilla/show_bug.cgi?id=23154
which we have not been able to reproduce.
With an input file: filter.inp
@EMAIL_FROM@ token
@EMAIL_FROM@ token
and a build file:
<project>
<property name="email.from" value="admin-dev@something.com"/>
<filter token="EMAIL_FROM" value="${email.from}" />
<delete quiet="yes" file="filter.out"/>
<copy file="filter.inp" tofile="filter.out" filtering="yes"/>
</project>
the problem can be reproduced.
Peter
Colin Sampaleanu wrote:
> I have a filter set as follows:
>
> <property name="email.from" value="admin-dev@something.com"/>
> ...
> <filter token="EMAIL_FROM" value="${email.from}" />
>
> this worked fine in ant 1.5, for replacing this filter value in a file
> with multiple @EMAIL_FROM@ tokens in it, via a copy task with filter="on"
>
> With ant 1.6, I now get this behaviour:
> [copy] Copying 1 file to
> D:\src\something\cvs\core\core-services\target\classes
> [copy] Replacing: @EMAIL_FROM@ -> admin-dev@something.com
> [copy] Inifinite loop in tokens. Currently known tokens :
> [EMAIL_FROM]
> [copy] Problem token : @EMAIL_FROM@ called from @EMAIL_FROM@
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> [copy] Replacing: @EMAIL_FROM@ -> EMAIL_FROM
> ... and so on
>
> Now obviously the @ sign in the email address is confusing the token
> processor, and it works fine if I replace it with another value, but
> this worked fine in ant 1.5!
>
> Can anybody confirm if this is a bug?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org