sb: Add support to get sources and hashses.

This commit is contained in:
Chris Johns
2014-08-09 23:49:29 +10:00
parent aaa015eda0
commit 4934771892
2 changed files with 41 additions and 3 deletions

View File

@@ -53,8 +53,8 @@ def _humanize_bytes(bytes, precision = 1):
def _hash_check(file_, absfile, macros, remove = True):
failed = False
if file_.lower() in macros.map_keys('hashes'):
m1, m2, hash = macros.get(file_.lower(), globals = False, maps = 'hashes')
hash = sources.get_hash(file_.lower(), macros)
if hash is not None:
hash = hash.split()
if len(hash) != 2:
raise error.internal('invalid hash format: %s' % (file_))