Bug 20870

Summary: FixCRLF changes srcdir's modification time
Product: Ant Reporter: Jonas Kilian <jonas.kilian>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P3    
Version: 1.5.3   
Target Milestone: 1.6   
Hardware: All   
OS: other   

Description Jonas Kilian 2003-06-18 14:13:25 UTC
...even if no files have actually been changed, because they were all up to 
date. This happens because FixCRLF creates a temp file in srcdir during 
processing.

I encountered this because consequential my tar file has always been build 
instead of stating "nothing to do...", e.g:

   <!-- take care of line endings -->
    <FixCRLF
      srcdir="${build.res}"
      tab="remove"
      tablength="8"
      eol="lf">
      <patternset refid="unix.shell.scripts.patternset"/>
      <patternset includes="**/*.properties"/>
    </FixCRLF>


    <mkdir dir="${dist.dir}"/>
    <tar destfile="${dist.dir}/${dist.server.name}.tar">
      <tarfileset prefix="res" dir="${build.res}">
        <exclude name="script/**"/>
      </tarfileset>
    </tar>

However, in my case I can workaround this problem by changing the Tar 
patternset to:

        <include name="/**"/>
        <exclude name="script/**"/>

(Note the slash before the two asterisk.)
Comment 1 Jonas Kilian 2003-06-18 15:03:17 UTC
Sorry, workaround is not correct: "/**" does not work, instead "subdir/**" 
works to omit the parent directory.
Comment 2 Antoine Levy-Lambert 2003-06-19 22:06:25 UTC
I have changed FixCrLf so that it will create the temporary file in the default 
temporary directory used by FileUtils#createTempFile
Note that there will still be a problem if the destDir of fixcrlf happens to be 
the directory where ant is running.
This is because the default for creating temporary files in ant is the current 
directory at execution time.
If you download the nightly build 2003-06-20 you should be OK.