Bug 20870 - FixCRLF changes srcdir's modification time
Summary: FixCRLF changes srcdir's modification time
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.5.3
Hardware: All other
: P3 minor (vote)
Target Milestone: 1.6
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-18 14:13 UTC by Jonas Kilian
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.