diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-03-08 21:51:15 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2010-03-08 21:55:50 +0000 |
commit | f83598d5154e9ce84a73de982c7ac494d797794d (patch) | |
tree | 02a818d590d08b1464037133ea4045a09aeb9e19 /classes | |
parent | 68ed1f674ff34c5403f55f41546524982ea79c37 (diff) |
base.bbclass: provide shortcut syntax for first anonymous entry in SRC_URI
Diffstat (limited to 'classes')
-rw-r--r-- | classes/base.bbclass | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index c083d48d85..bbc1cc78dc 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -61,10 +61,14 @@ def base_chk_file_vars(parser, localpath, params, data): name = params["name"] except KeyError: return False - flagName = "%s.md5sum" % name - want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data) - flagName = "%s.sha256sum" % name - want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data) + if name: + md5flag = "%s.md5sum" % name + sha256flag = "%s.sha256sum" % name + else: + md5flag = "md5sum" + sha256flag = "sha256sum" + want_md5sum = bb.data.getVarFlag("SRC_URI", md5flag, data) + want_sha256sum = bb.data.getVarFlag("SRC_URI", sha256flag, data) if (want_sha256sum == None and want_md5sum == None): # no checksums to check, nothing to do @@ -702,12 +706,18 @@ python base_do_fetch() { pn = bb.data.getVar('PN', d, True) # Check each URI + first_uri = True for url in src_uri.split(): localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) (type,host,path,_,_,params) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: if type in [ "http", "https", "ftp", "ftps" ]: + # We provide a default shortcut of plain [] for the first fetch uri + # Explicit names in any uri overrides this default. + if not "name" in params and first_uri: + first_uri = False + params["name"] = "" if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)): if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True): bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri)) |