FAQ
Repository: ant
Updated Branches:
   refs/heads/1.9.x 647bdfb2d -> 5c24a75a7


fix possible race-condition

similar to https://bz.apache.org/bugzilla/show_bug.cgi?id=55290

Reported by Yoshiki Higo, Shinpei Hayashi, Hideaki Hata and Mei Nagappan


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/5c24a75a
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/5c24a75a
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/5c24a75a

Branch: refs/heads/1.9.x
Commit: 5c24a75a782d880ddb4ebca79f121066c531ee16
Parents: 647bdfb
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Fri May 13 19:54:21 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Fri May 13 19:54:21 2016 +0200

----------------------------------------------------------------------
  src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/5c24a75a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
index f514fc6..a47b230 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
@@ -487,7 +487,7 @@ public abstract class MSVSS extends Task implements MSVSSConstants {
              //make sure m_LocalDir exists, create it if it doesn't
              File dir = getProject().resolveFile(localPath);
              if (!dir.exists()) {
- boolean done = dir.mkdirs();
+ boolean done = dir.mkdirs() || dir.exists();
                  if (!done) {
                      String msg = "Directory " + localPath + " creation was not "
                              + "successful for an unknown reason";

Search Discussions

  • Bodewig at May 13, 2016 at 6:00 pm
    Repository: ant
    Updated Branches:
       refs/heads/master 0c2ca5525 -> fc0b2ab11


    fix possible race-condition

    similar to https://bz.apache.org/bugzilla/show_bug.cgi?id=55290

    Reported by Yoshiki Higo, Shinpei Hayashi, Hideaki Hata and Mei Nagappan


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/5c24a75a
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/5c24a75a
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/5c24a75a

    Branch: refs/heads/master
    Commit: 5c24a75a782d880ddb4ebca79f121066c531ee16
    Parents: 647bdfb
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Fri May 13 19:54:21 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Fri May 13 19:54:21 2016 +0200

    ----------------------------------------------------------------------
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/5c24a75a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
    index f514fc6..a47b230 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
    @@ -487,7 +487,7 @@ public abstract class MSVSS extends Task implements MSVSSConstants {
                  //make sure m_LocalDir exists, create it if it doesn't
                  File dir = getProject().resolveFile(localPath);
                  if (!dir.exists()) {
    - boolean done = dir.mkdirs();
    + boolean done = dir.mkdirs() || dir.exists();
                      if (!done) {
                          String msg = "Directory " + localPath + " creation was not "
                                  + "successful for an unknown reason";
  • Bodewig at May 13, 2016 at 6:00 pm
    Merge branch '1.9.x'


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/fc0b2ab1
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/fc0b2ab1
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/fc0b2ab1

    Branch: refs/heads/master
    Commit: fc0b2ab11dfdf271a2b9487ac73b86743fbb3e91
    Parents: 0c2ca55 5c24a75
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Fri May 13 19:56:10 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Fri May 13 19:56:10 2016 +0200

    ----------------------------------------------------------------------
      src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java | 2 +-
      1 file changed, 1 insertion(+), 1 deletion(-)
    ----------------------------------------------------------------------
  • Bodewig at May 19, 2016 at 4:40 am
    Repository: ant
    Updated Branches:
       refs/heads/master 8e87ef9e6 -> 3c37952d6


    <zip> up-to-date check doesn't work properly on NTFS

    https://bz.apache.org/bugzilla/show_bug.cgi?id=59562

    Patch by Gilles QUERRET


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/0edf3ca2
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/0edf3ca2
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/0edf3ca2

    Branch: refs/heads/master
    Commit: 0edf3ca2524323395d9de340dc1927cb5f3ee267
    Parents: 5c24a75
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Thu May 19 06:31:42 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Thu May 19 06:31:42 2016 +0200

    ----------------------------------------------------------------------
      CONTRIBUTORS | 1 +
      WHATSNEW | 4 ++++
      contributors.xml | 4 ++++
      src/etc/testcases/taskdefs/zip.xml | 19 +++++++++++++++++++
      src/main/org/apache/tools/ant/taskdefs/Zip.java | 9 +++++++--
      .../org/apache/tools/ant/taskdefs/ZipTest.java | 8 ++++++++
      6 files changed, 43 insertions(+), 2 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/CONTRIBUTORS
    ----------------------------------------------------------------------
    diff --git a/CONTRIBUTORS b/CONTRIBUTORS
    index 74d6c63..8e47e05 100644
    --- a/CONTRIBUTORS
    +++ b/CONTRIBUTORS
    @@ -136,6 +136,7 @@ Georges-Etienne Legendre
      Gero Vermaas
      Gerrit Riessen
      Gilbert Rebhan
    +Gilles Querret
      Gilles Scokart
      Glenn McAllister
      Glenn Twiggs

    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/WHATSNEW
    ----------------------------------------------------------------------
    diff --git a/WHATSNEW b/WHATSNEW
    index 68338fc..e01128c 100644
    --- a/WHATSNEW
    +++ b/WHATSNEW
    @@ -15,6 +15,10 @@ Fixed bugs:
       * <get>'s quiet attribute was broken, it didn't suppress any messages.
         Bugzilla Report 59379

    + * <zip>'s check whether an archive is already up-to-date failed on
    + NTFS filesystems and re-created archives more often than necessary.
    + Bugzilla Report 59562
    +
      Other changes:
      --------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/contributors.xml
    ----------------------------------------------------------------------
    diff --git a/contributors.xml b/contributors.xml
    index 85066b7..2bfa1b0 100644
    --- a/contributors.xml
    +++ b/contributors.xml
    @@ -570,6 +570,10 @@
        </name>
        <name>
          <first>Gilles</first>
    + <last>Querret</last>
    + </name>
    + <name>
    + <first>Gilles</first>
          <last>Scokart</last>
        </name>
        <name>

    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/src/etc/testcases/taskdefs/zip.xml
    ----------------------------------------------------------------------
    diff --git a/src/etc/testcases/taskdefs/zip.xml b/src/etc/testcases/taskdefs/zip.xml
    index 4fa6de6..61a54a3 100644
    --- a/src/etc/testcases/taskdefs/zip.xml
    +++ b/src/etc/testcases/taskdefs/zip.xml
    @@ -283,5 +283,24 @@
          <zip destFile="${output}/test3.zip" basedir="${output}/ziptest" update="true"/>
        </target>

    + <target name="testRegexpMapper1">
    + <mkdir dir="${output}/regexp.src"/>
    + <touch file="${output}/regexp.src/file1"/>
    + <zip destFile="${output}/regexp.zip">
    + <mappedresources>
    + <fileset dir="${output}/regexp.src" includes="file1" />
    + <regexpmapper from="^(([a-z][a-z]).*)" to="\2/\1.r" />
    + </mappedresources>
    + </zip>
    + </target>
    + <target name="testRegexpMapper2">
    + <sleep seconds="3" />
    + <zip destFile="${output}/regexp.zip">
    + <mappedresources>
    + <fileset dir="${output}/regexp.src" includes="file1" />
    + <regexpmapper from="^(([a-z][a-z]).*)" to="\2/\1.r" />
    + </mappedresources>
    + </zip>
    + </target>

      </project>

    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ----------------------------------------------------------------------
    diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java
    index ddc9bd4..91e28b9 100644
    --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java
    +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java
    @@ -78,7 +78,11 @@ import org.apache.tools.zip.ZipOutputStream.UnicodeExtraFieldPolicy;
       */
      public class Zip extends MatchingTask {
          private static final int BUFFER_SIZE = 8 * 1024;
    - private static final int ROUNDUP_MILLIS = 1999; // 2 seconds - 1
    + /**
    + * The granularity of timestamps inside a ZIP archive.
    + */
    + private static final int ZIP_FILE_TIMESTAMP_GRANULARITY = 2000;
    + private static final int ROUNDUP_MILLIS = ZIP_FILE_TIMESTAMP_GRANULARITY - 1;
          // CheckStyle:VisibilityModifier OFF - bc

          protected File zipFile;
    @@ -1548,7 +1552,8 @@ public class Zip extends MatchingTask {
              final Resource[] rs = selectFileResources(initial);
              Resource[] result =
                  ResourceUtils.selectOutOfDateSources(this, rs, mapper,
    - getZipScanner());
    + getZipScanner(),
    + ZIP_FILE_TIMESTAMP_GRANULARITY);
              if (!doFilesonly) {
                  final Union u = new Union();
                  u.addAll(Arrays.asList(selectDirectoryResources(initial)));

    http://git-wip-us.apache.org/repos/asf/ant/blob/0edf3ca2/src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java
    ----------------------------------------------------------------------
    diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java
    index 5a7a359..efa9f77 100644
    --- a/src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java
    +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java
    @@ -297,4 +297,12 @@ public class ZipTest {
              }
          }

    + @Test
    + public void testRegexpMapper() throws IOException {
    + buildRule.executeTarget("testRegexpMapper1");
    + File testFile = new File(buildRule.getOutputDir(), "regexp.zip");
    + long l = testFile.lastModified();
    + buildRule.executeTarget("testRegexpMapper2");
    + assertEquals(l, testFile.lastModified());
    + }
      }
  • Bodewig at May 19, 2016 at 4:40 am
    Merge branch '1.9.x'


    Project: http://git-wip-us.apache.org/repos/asf/ant/repo
    Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/3c37952d
    Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/3c37952d
    Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/3c37952d

    Branch: refs/heads/master
    Commit: 3c37952d6955923f2aca522d63716c184f2e396b
    Parents: 8e87ef9 0edf3ca
    Author: Stefan Bodewig <bodewig@apache.org>
    Authored: Thu May 19 06:39:56 2016 +0200
    Committer: Stefan Bodewig <bodewig@apache.org>
    Committed: Thu May 19 06:39:56 2016 +0200

    ----------------------------------------------------------------------
      CONTRIBUTORS | 1 +
      WHATSNEW | 4 ++++
      contributors.xml | 4 ++++
      src/etc/testcases/taskdefs/zip.xml | 19 +++++++++++++++++++
      src/main/org/apache/tools/ant/taskdefs/Zip.java | 9 +++++++--
      .../org/apache/tools/ant/taskdefs/ZipTest.java | 8 ++++++++
      6 files changed, 43 insertions(+), 2 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/ant/blob/3c37952d/WHATSNEW
    ----------------------------------------------------------------------

    http://git-wip-us.apache.org/repos/asf/ant/blob/3c37952d/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ----------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnotifications @
categoriesant
postedMay 13, '16 at 5:55p
activeMay 19, '16 at 4:40a
posts5
users1
websiteant.apache.org

1 user in discussion

Bodewig: 5 posts

People

Translate

site design / logo © 2018 Grokbase