From: Martin Jansa Date: Thu, 30 Mar 2023 21:22:28 +0000 (+0200) Subject: cargo-update-recipe-crates.bbclass: always use name parameter X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fjansa%2Fcargo;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git cargo-update-recipe-crates.bbclass: always use name parameter * even if there is only one version per Cargo.lock file, there might be other Cargo.lock files with the same crate but different version * we would need to process all Cargo.lock files at the same time before writting but it's easier to just use name paramter even when there is only one version Signed-off-by: Martin Jansa --- diff --git a/meta/classes-recipe/cargo-update-recipe-crates.bbclass b/meta/classes-recipe/cargo-update-recipe-crates.bbclass index daa363b0dd6..05e1f090ae7 100644 --- a/meta/classes-recipe/cargo-update-recipe-crates.bbclass +++ b/meta/classes-recipe/cargo-update-recipe-crates.bbclass @@ -38,25 +38,12 @@ def get_crates(f): if not crates_candidates: raise ValueError("Unable to find any candidate crates that use crates.io") - # Build a list of crates name that have multiple version - crates_multiple_vers = [] - tmp = [] - for c in crates_candidates: - if c['name'] in tmp: - crates_multiple_vers.append(c['name']) - else: - tmp.append(c['name']) - # Update crates uri and their checksum, to avoid name clashing on the checksum # we need to rename crates of the same name but different version cksum_list = '' for c in crates_candidates: - if c['name'] in crates_multiple_vers: - rename = "%s-%s" % (c['name'], c['version']) - c_list += '\n crate://crates.io/%s/%s;name=%s \\\' % (c['name'], c['version'], rename) - else: - rename = c['name'] - c_list += '\n crate://crates.io/%s/%s \\\' % (c['name'], c['version']) + rename = "%s-%s" % (c['name'], c['version']) + c_list += '\n crate://crates.io/%s/%s;name=%s \\\' % (c['name'], c['version'], rename) if 'checksum' in c: cksum_list += '\nSRC_URI[%s.sha256sum] = "%s"' % (rename, c['checksum'])