ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <ch...@sixlegs.com>
Subject [PATCH] Fix broken checksum fileset handling
Date Tue, 13 Aug 2002 06:59:10 GMT
After much hand-wringing I have discovered that checksums are broken
under the following conditions:

 (using verifyproperty OR in a condition) AND using filesets with
  multiple files

The property/condition is set/true based on the checksum of the last
file in the fileset, not the logical AND over all the files. This was
verified by looking at the latest CVS source.

I've included a simple patch that works for me.

-Chris

Index: Checksum.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Checksum.java,v
retrieving revision 1.26
diff -u -r1.26 Checksum.java
--- Checksum.java	25 Jul 2002 15:21:04 -0000	1.26
+++ Checksum.java	13 Aug 2002 06:51:20 -0000
@@ -398,7 +398,8 @@
                 if (destination instanceof java.lang.String) {
                     String prop = (String) destination;
                     if (isCondition) {
-                        checksumMatches = checksum.equals(property);
+                        checksumMatches = checksumMatches &&
+                            checksum.equals(property);
                     } else {
                         getProject().setNewProperty(prop, checksum);
                     }
@@ -414,7 +415,7 @@
                             fis = null;
                             br.close();
                             isr.close();
-                            checksumMatches =
+                            checksumMatches = checksumMatches &&
                                 checksum.equals(suppliedChecksum);
                         } else {
                             checksumMatches = false;

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message