ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36748] New: - Ant checksum totalproperty does not match across platforms.
Date Tue, 20 Sep 2005 20:19:28 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36748>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36748

           Summary: Ant checksum totalproperty does not match across
                    platforms.
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: david_orendac@choicehotels.com


The Ant checksum core task does not appear to work correctly across platforms
for the totalproperty checksum calculation of a fileset.  

Calculating a total checksum for a fileset will result in different final single
checksum values on different platforms such as Windows and Linux.  The reason
appears to be that the individual file checksums are kept in a map keyed by a
File object and the final checksum is calculated by passing over the Keyset of
the Map after it goes through an Array.sort().  The File.compareTo(File file)
behaviour is different under Windows and Linux, because of case sensitivity or
sort ordering, so order of files processed can differ.  This would result in a
different final checksum on the two systems.  The Keyset needs to somehow be
ordered instead by the normalized relativePath value (all '/' as separators) so
processing uses consistent ordering across environments.

Test case:  Files in two directories with different case:

WEB-INF/foo1.txt
static/foo2.txt

<patternset id="file.list">
	<include name="WEB-INF/**"/>
	<include name="ccstatic/**"/>
</patternset>


The ordering changes from Windows to Linux resulting in different final checksums.

>From File.compareTo() documentation for java 1.4.2:

Compares two abstract pathnames lexicographically. The ordering defined by this
method depends upon the underlying system. On UNIX systems, alphabetic case is
significant in comparing pathnames; on Microsoft Windows systems it is not.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message