ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r738662 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/util/ test/repositories/checksums/allright/
Date Wed, 28 Jan 2009 23:14:12 GMT
Author: maartenc
Date: Wed Jan 28 23:14:05 2009
New Revision: 738662

URL: http://svn.apache.org/viewvc?rev=738662&view=rev
Log:
FIX: Support for opensll sha1 and md5 checksum (IVY-1006)

Added:
    ant/ivy/core/trunk/test/repositories/checksums/allright/allright-1.0.jar.sha1
    ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar
  (with props)
    ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar.sha1
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java
    ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml
    ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml.md5

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=738662&r1=738661&r2=738662&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Jan 28 23:14:05 2009
@@ -93,6 +93,7 @@
 - IMPROVEMENT: Error message is not clear when specifying an invalid value for checksums
(IVY-977)
 - IMPROVEMENT: catch AccessControlException on System.getProperties() (IVY-1015)
 
+- FIX: Support for opensll sha1 and md5 checksum (IVY-1006)
 - FIX: TTL does not work as expected (IVY-1012)
 - FIX: Listing of URL's under a given URL does not handle fully specified URL's (IVY-959)
(thanks to Randy Nott)
 - FIX: <ivy:buildnumber> returns wrong result when resolve fails (IVY-970)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java?rev=738662&r1=738661&r2=738662&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java Wed Jan 28 23:14:05
2009
@@ -55,13 +55,19 @@
         String csFileContent = FileUtil.readEntirely(
             new BufferedReader(new FileReader(checksumFile))).trim().toLowerCase(Locale.US);
         String expected;
-        int spaceIndex = csFileContent.indexOf(' ');
-        if (spaceIndex != -1) {
-            expected = csFileContent.substring(0, spaceIndex);
+        if (csFileContent.indexOf(' ') > -1
+                && (csFileContent.startsWith("md") || csFileContent.startsWith("sha")))
{
+            int lastSpaceIndex = csFileContent.lastIndexOf(' ');
+            expected = csFileContent.substring(lastSpaceIndex + 1);
         } else {
-            expected = csFileContent;
+            int spaceIndex = csFileContent.indexOf(' ');
+            if (spaceIndex != -1) {
+                expected = csFileContent.substring(0, spaceIndex);
+            } else {
+                expected = csFileContent;
+            }
         }
-
+        
         String computed = computeAsString(dest, algorithm).trim().toLowerCase(Locale.US);
         if (!expected.equals(computed)) {
             throw new IOException("invalid " + algorithm + ": expected=" + expected + " computed="

Added: ant/ivy/core/trunk/test/repositories/checksums/allright/allright-1.0.jar.sha1
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/checksums/allright/allright-1.0.jar.sha1?rev=738662&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/checksums/allright/allright-1.0.jar.sha1 (added)
+++ ant/ivy/core/trunk/test/repositories/checksums/allright/allright-1.0.jar.sha1 Wed Jan
28 23:14:05 2009
@@ -0,0 +1 @@
+1acaeaa173e330150b59da1b2fd6bc8597b6992c
\ No newline at end of file

Added: ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar?rev=738662&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar.sha1
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar.sha1?rev=738662&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar.sha1
(added)
+++ ant/ivy/core/trunk/test/repositories/checksums/allright/allright-with-openssl-1.0.jar.sha1
Wed Jan 28 23:14:05 2009
@@ -0,0 +1 @@
+SHA1(allright-with-openssl-1.0.jar)= 1acaeaa173e330150b59da1b2fd6bc8597b6992c
\ No newline at end of file

Modified: ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml?rev=738662&r1=738661&r2=738662&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml (original)
+++ ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml Wed Jan 28 23:14:05
2009
@@ -25,5 +25,6 @@
 	<publications>
 		<artifact />
 		<artifact name="allright-with-path" />
+		<artifact name="allright-with-openssl" />
 	</publications>
 </ivy-module>

Modified: ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml.md5
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml.md5?rev=738662&r1=738661&r2=738662&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml.md5 (original)
+++ ant/ivy/core/trunk/test/repositories/checksums/allright/ivy-1.0.xml.md5 Wed Jan 28 23:14:05
2009
@@ -1 +1 @@
-69531be8c29b2cca090894b3f4d564fe
\ No newline at end of file
+e623dc9cd994a8b48e539882704afc54
\ No newline at end of file



Mime
View raw message