Browse Source

Make checksum work with nested filesets and no total property

Make checksum less loud, downgrading message calculating checksum to verbose
PR: 25606
PR: 25607
Submitted by: Ariel Backenroth ( abackenr at interwoven dot com )


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275806 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
b19b9b4113
4 changed files with 15 additions and 2 deletions
  1. +2
    -0
      WHATSNEW
  2. +8
    -0
      src/etc/testcases/taskdefs/checksum.xml
  3. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Checksum.java
  4. +3
    -0
      src/testcases/org/apache/tools/ant/taskdefs/ChecksumTest.java

+ 2
- 0
WHATSNEW View File

@@ -93,6 +93,8 @@ Changes that could break older environments:
are resolved at a later stage. This causes some
differences especially for user defined task containers.

* <checksum> log message "Calculating checksum ..." has been degraded from INFO to VERBOSE.

Fixed bugs:
-----------
* Filter readers were not handling line endings properly. Bugzilla


+ 8
- 0
src/etc/testcases/taskdefs/checksum.xml View File

@@ -65,4 +65,12 @@
</fileset>
</checksum>
</target>
<!-- bug report 25606 -->
<target name="verifyChecksumdirNoTotal">
<checksum todir="${basedir}/checksum/checksums">
<fileset dir="${basedir}/checksum">
<exclude name="**/*.MD5"/>
</fileset>
</checksum>
</target>
</project>

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Checksum.java View File

@@ -374,7 +374,7 @@ public class Checksum extends MatchingTask implements Condition {
String[] srcFiles = ds.getIncludedFiles();
for (int j = 0; j < srcFiles.length; j++) {
File src = new File(fs.getDir(getProject()), srcFiles[j]);
if (totalproperty != null) {
if (totalproperty != null || todir != null) {
// Use '/' to calculate digest based on file name.
// This is required in order to get the same result
// on different platforms.
@@ -467,7 +467,7 @@ public class Checksum extends MatchingTask implements Condition {
messageDigest.reset();
File src = (File) e.nextElement();
if (!isCondition) {
log("Calculating " + algorithm + " checksum for " + src);
log("Calculating " + algorithm + " checksum for " + src, Project.MSG_VERBOSE);
}
fis = new FileInputStream(src);
DigestInputStream dis = new DigestInputStream(fis,


+ 3
- 0
src/testcases/org/apache/tools/ant/taskdefs/ChecksumTest.java View File

@@ -125,6 +125,9 @@ public class ChecksumTest extends BuildFileTest {
expectPropertySet("verifyFromProperty", "verify", "true");
}

public void testVerifyChecksumdirNoTotal() {
executeTarget("verifyChecksumdirNoTotal");
}
private void testVerify(String target) {
assertNull(project.getProperty("logo.MD5"));
assertNull(project.getProperty("no.logo.MD5"));


Loading…
Cancel
Save