# HG changeset patch # User Bernhard Urban # Date 1394620833 -3600 # Node ID e666c172c9aa652a40836859bc1452930271a27a # Parent e328f28f7401679160da56fb6a9c07bd6f0bc3a4 mx: some cleanup around sha1 digest support diff -r e328f28f7401 -r e666c172c9aa mxtool/mx.py --- 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)