> -----Original Message-----
> From: [email protected] 
> <[email protected]> On Behalf Of Martin Schwan via 
> lists.openembedded.org
> Sent: den 12 december 2025 10:19
> To: [email protected]
> Subject: [OE-core] [PATCH v2 3/5] cargo-update-recipe-crates: Consistently 
> use single quotes in Python
> 
> For the Python function do_update_crates(), consistently use single
> quotes for Python strings. No functional changes.
> 
> Signed-off-by: Martin Schwan <[email protected]>
> ---
> Changes in v2:
>   - Split changes into multiple patches, for improved readability
> ---
>  meta/classes-recipe/cargo-update-recipe-crates.bbclass | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes-recipe/cargo-update-recipe-crates.bbclass 
> b/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> index d3745392bd..6e82bd4a51 100644
> --- a/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> +++ b/meta/classes-recipe/cargo-update-recipe-crates.bbclass
> @@ -45,7 +45,7 @@ python do_update_crates() {
>          # we need to rename crates with name and version to have a unique key
>          cksum_list = ''
>          for c in crates_candidates:
> -            rename = "%s-%s" % (c['name'], c['version'])
> +            rename = '%s-%s' % (c['name'], c['version'])
>              c_list += '\n    crate://crates.io/%s/%s \\' % (c['name'], 
> c['version'])
>              if 'checksum' in c:
>                  cksum_list += '\nSRC_URI[%s.sha256sum] = "%s"' % (rename, 
> c['checksum'])
> @@ -56,7 +56,7 @@ python do_update_crates() {
>          return c_list
> 
>      import os
> -    crates = d.expand("# Autogenerated with 'bitbake -c update_crates 
> ${PN}'\n\n")
> +    crates = d.expand('# Autogenerated with \'bitbake -c update_crates 
> ${PN}\'\n\n')

IMHO, avoiding unnecessary backslashes is preferable to only using
apostrophes to quote strings. So I would skip this and the one below.

>      found = False
>      for root, dirs, files in os.walk(cargo_lock_src_dir):
>          # ignore git and patches directories
> @@ -76,5 +76,5 @@ python do_update_crates() {
>          bb.error(f'Unable to find any Cargo.lock in {cargo_lock_src_dir}')
>      open(target_file, 'w').write(crates)
> 
> -    bb.note(f"Successfully update crates inside '{target_file}'")
> +    bb.note(f'Successfully update crates inside \'{target_file}\'')
>  }
> --
> 2.43.0

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#227578): 
https://lists.openembedded.org/g/openembedded-core/message/227578
Mute This Topic: https://lists.openembedded.org/mt/116743598/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to