ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45094] New: Token substitution problem - where file includes literal character the same as the token
Date Thu, 29 May 2008 10:25:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45094

           Summary: Token substitution problem - where file includes literal
                    character the same as the token
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: stuart@henderson-web.co.uk


One of my targets is doing a copy, with a re-name and token substitution, with
the code below.


        <copy  todir="${build.dir}" >
            <fileset  dir="." />
            <mapper  type="regexp"
                     from="(.*)\.IN"
                     to="\1" />
            <filterset  begintoken="${TOKEN}"
                        endtoken="${TOKEN}" >
                <filtersfile  file="token.values" />
            </filterset>
        </copy>


I have TOKEN defined in a property file.
Initially I used '@', but I would prefer to use '@@'

In one of the files that get copied, I need a line ending up like this :
    username@hostname
i.e it has a literal character @ which isn't part of a tokenized value.

So in its' tokenized form, I have
EITHER
    @USER@@@HOST@           .... if I use a single @ for the token delimiters
OR
    @@USER@@@@@HOST@@       .... if I use a double @@ for the token delimiters

The token substitution works OK for the single '@' delimiter
But when using the '@@' delimiter it fails. The copied file ends up with :
    username@@@HOST@@

Strangely, if I needed the result   username@@hostname   then use of either a
single @ or double @@
delimiter works correctly!


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message