diff options
Diffstat (limited to 'meta/classes/utils.bbclass')
-rw-r--r-- | meta/classes/utils.bbclass | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 02e803a70..746f46ce5 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass @@ -83,77 +83,6 @@ def oe_system(d, cmd, **kwargs): kwargs["shell"] = True return oe_popen(d, cmd, **kwargs).wait() -# for MD5/SHA handling -def base_chk_load_parser(config_paths): - import ConfigParser - parser = ConfigParser.ConfigParser() - if len(parser.read(config_paths)) < 1: - raise ValueError("no ini files could be found") - - return parser - -def base_chk_file(parser, pn, pv, src_uri, localpath, data): - no_checksum = False - # Try PN-PV-SRC_URI first and then try PN-SRC_URI - # we rely on the get method to create errors - pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri) - pn_src = "%s-%s" % (pn,src_uri) - if parser.has_section(pn_pv_src): - md5 = parser.get(pn_pv_src, "md5") - sha256 = parser.get(pn_pv_src, "sha256") - elif parser.has_section(pn_src): - md5 = parser.get(pn_src, "md5") - sha256 = parser.get(pn_src, "sha256") - elif parser.has_section(src_uri): - md5 = parser.get(src_uri, "md5") - sha256 = parser.get(src_uri, "sha256") - else: - no_checksum = True - - # md5 and sha256 should be valid now - if not os.path.exists(localpath): - bb.note("The localpath does not exist '%s'" % localpath) - raise Exception("The path does not exist '%s'" % localpath) - - - # Calculate the MD5 and 256-bit SHA checksums - md5data = bb.utils.md5_file(localpath) - 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") - - if no_checksum == True: # we do not have conf/checksums.ini entry - try: - file = open("%s/checksums.ini" % bb.data.getVar("TMPDIR", data, 1), "a") - except: - return False - - if not file: - raise Exception("Creating checksums.ini failed") - - file.write("[%s]\nmd5=%s\nsha256=%s\n\n" % (src_uri, md5data, shadata)) - file.close() - return False - - if not md5 == md5data: - bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (md5,md5data)) - raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data)) - - if not sha256 == shadata: - bb.note("The SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256,shadata)) - raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata)) - - return True - oe_soinstall() { # Purpose: Install shared library file and # create the necessary links |