changeset 14154:e666c172c9aa

mx: some cleanup around sha1 digest support
author Bernhard Urban <bernhard.urban@jku.at>
date Wed, 12 Mar 2014 11:40:33 +0100
parents e328f28f7401
children 1ac6195ee586
files mxtool/mx.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Wed Mar 12 11:23:56 2014 +0100
+++ b/mxtool/mx.py	Wed Mar 12 11:40:33 2014 +0100
@@ -349,9 +349,9 @@
 
     def _sha1Cached():
         with open(sha1path, 'r') as f:
-            return f.readline()[0:40]
-
-    def _writesha1Cached():
+            return f.read()[0:40]
+
+    def _writeSha1Cached():
         with open(sha1path, 'w') as f:
             f.write(_sha1OfFile())
 
@@ -365,13 +365,13 @@
         _download_lib()
 
     if sha1 and not exists(sha1path):
-        _writesha1Cached()
+        _writeSha1Cached()
 
     if sha1 and sha1 != _sha1Cached():
         _download_lib()
         if sha1 != _sha1OfFile():
             abort("SHA1 does not match for " + name + ". Broken download? SHA1 not updated in projects file?")
-        _writesha1Cached()
+        _writeSha1Cached()
 
     return path
 
@@ -427,7 +427,7 @@
             path = join(self.suite.dir, path)
         sha1path = path + '.sha1'
 
-        return _download_file_with_sha1(self.name, path, self.sourceUrls, self.sha1, sha1path, resolve, len(self.sourceUrls) != 0, sources=True)
+        return _download_file_with_sha1(self.name, path, self.sourceUrls, self.sourceSha1, sha1path, resolve, len(self.sourceUrls) != 0, sources=True)
 
     def append_to_classpath(self, cp, resolve):
         path = self.get_path(resolve)