diff options
| author | Koen Kooi <koen@openembedded.org> | 2007-10-18 12:12:05 +0000 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2007-10-18 12:12:05 +0000 |
| commit | b5bfd7f1fd6bd34ef51701e918b40f724cb46258 (patch) | |
| tree | 005a7d449e934743db904d5c09d8c4981e2971b5 /classes/base.bbclass | |
| parent | 1c5df3f485ba9992931e06d07f28c57a29d89e5e (diff) | |
| parent | d1b8caf7848752ca2f69f1ecdc7791e83457c7ff (diff) | |
propagate from branch 'org.openembedded.dev' (head d46c4661bf8a227094ce244e37836233fb938268)
to branch 'org.openembedded.dev.avr32' (head 7cd1ae5351316a6cdc9fe3db60bb05198d50af39)
Diffstat (limited to 'classes/base.bbclass')
| -rw-r--r-- | classes/base.bbclass | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 999d409914..2cf205fbe9 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -22,6 +22,7 @@ def base_chk_load_parser(config_path): def base_chk_file(parser, pn, pv, src_uri, localpath, data): import os, bb + 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) @@ -36,8 +37,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data): md5 = parser.get(src_uri, "md5") sha256 = parser.get(src_uri, "sha256") else: - return False - #raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri)) + no_checksum = True # md5 and sha256 should be valid now if not os.path.exists(localpath): @@ -60,6 +60,19 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data): except OSError: raise Exception("Executing shasum failed") + 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)) @@ -485,11 +498,9 @@ python base_do_fetch() { (type,host,path,_,_,_) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: - if not base_chk_file(parser, pn, pv,uri, localpath, d): - if type != "file": + if type == "http" or type == "https" or type == "ftp" or type == "ftps": + if not base_chk_file(parser, pn, pv,uri, localpath, d): bb.note("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri)) - else: - bb.debug("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri)) except Exception: raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) } |
