diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-02-25 13:11:28 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-02-25 13:11:51 -0700 |
commit | 22ee98e2fc4d58de61184332e41b9a44c949ed17 (patch) | |
tree | 8a6a67baa16d6c6a51ddc5abac7053c5bafaddd8 | |
parent | 697cd2dbb419222949fbf85be5b3c12978e98ad7 (diff) |
Revert "base.bbclass: use bb.utils.*_sum instead of calling md5/sha sum commands"
Back this out for the time being, things are exploding now.
This reverts commit df32920678d15c86897b50b752b937210a01edea.
-rw-r--r-- | classes/base.bbclass | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 72e57300d8..990e75ee14 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -76,26 +76,23 @@ def base_chk_file_vars(parser, localpath, params, data): raise Exception("The path does not exist '%s'" % localpath) if want_md5sum: - md5data = bb.utils.md5_file(localpath) - + try: + md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath)) + md5data = (md5pipe.readline().split() or [ "" ])[0] + md5pipe.close() + except OSError, e: + raise Exception("Executing md5sum failed") if want_md5sum != md5data: bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (want_md5sum, md5data)) raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (want_md5sum, md5data)) if want_sha256sum: - shadata = bb.utils.sha256_file(localpath) - - # sha256_file() can return None if we are running on Python 2.4 (hashlib is - # 2.5 onwards, sha in 2.4 is 160-bit only), so check for this and call the - # standalone shasum binary if required. - if shadata is None: - try: - shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath)) - shadata = (shapipe.readline().split() or [ "" ])[0] - shapipe.close() - except OSError: - raise Exception("Executing shasum failed, please build shasum-native") - + try: + shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath)) + sha256data = (shapipe.readline().split() or [ "" ])[0] + shapipe.close() + except OSError, e: + raise Exception("Executing shasum failed") if want_sha256sum != sha256data: bb.note("The SHA256Sums did not match. Wanted: '%s' and Got: '%s'" % (want_sha256sum, sha256data)) raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (want_sha256sum, sha256data)) |