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 51646] New: pathconvert - mapper using OS directory separator instead of dirsep
Date Thu, 11 Aug 2011 01:50:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51646

             Bug #: 51646
           Summary: pathconvert - mapper using OS directory separator
                    instead of dirsep
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: szetheli+apache@gmail.com
    Classification: Unclassified


It looks like pathcovert is using the OS directory separator for processing
mapper even if a custom dirsep is specified.

I'm trying to write pathcovert statement that is OS agnostic, so I turn
dirsep="/" since I don't want to deal with windows "\".  I need to do some
manipulation on the path as well, turning the file names into properties, so I
use mapper to strip the parts I don't need.

Example:
<pathconvert property="-service.fragments.properties"
pathsep="=${line.separator}" dirsep="/"
  refid="-service.fragment.path" >
    <chainedmapper>
      <filtermapper>
    <!-- BUGBUG - even though dirsep=/, the filter sees \ on windows.  The
below line is necessary to make windows/linux treat the path the same-->
    <replacestring from="\" to="/" />
    <replaceregex pattern=".*/([^/]*)" replace="\1"/>
      </filtermapper>
    </chainedmapper>
</pathconvert>

Expected:
If I comment out the replacestring statement, mapper should see the path
elements as "a/b/c/file".

Actual:
with replacestring commented, replaceregex does not match, because its seeing
a\b\c\file

Work around:
Adding replacestring statement in place of the dirsep attribute (yuck).

-- 
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