public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta/recipes-devtools/sbuild-chroot: Use modern python formatting
@ 2025-01-14 11:00 srinuvasan.a via isar-users
  2025-01-21 13:58 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: srinuvasan.a via isar-users @ 2025-01-14 11:00 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, ubely, srinuvasan

From: srinuvasan <srinuvasan.a@siemens.com>

f-strings are faster and better than str.format(), and Moreover
f-strings provide a concise and convenient way to embed Python expressions
inside string literals for formatting, hence use f-strings rather than str.format().

Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
---
 .../recipes-devtools/sbuild-chroot/sbuild-chroot.inc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index d794c6fd..6478d3a6 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -23,21 +23,21 @@ python() {
 
     if d.getVar('DISTRO_GCC'):
         d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
-                    ' libgcc-{}-dev:{}'.format(distro_gcc, distro_arch))
+                    f" libgcc-{distro_gcc}-dev:{distro_arch}")
         d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
-                    ' libstdc++-{}-dev:{}'.format(distro_gcc, distro_arch))
+                    f" libstdc++-{distro_gcc}-dev:{distro_arch}")
 
     if bb.utils.to_boolean(d.getVar('ISAR_ENABLE_COMPAT_ARCH')):
         compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
         d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
-                    ' libc6-dev:{}'.format(compat_arch))
+                    f" libc6-dev:{compat_arch}")
         d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
-                    ' crossbuild-essential-{}'.format(compat_arch))
+                    f" crossbuild-essential-{compat_arch}")
         if d.getVar('DISTRO_GCC'):
             d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
-                        ' libgcc-{}-dev:{}'.format(distro_gcc, compat_arch))
+                        f" libgcc-{distro_gcc}-dev:{compat_arch}")
             d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
-                        ' libstdc++-{}-dev:{}'.format(distro_gcc, compat_arch))
+                        f" libstdc++-{distro_gcc}-dev:{compat_arch}")
 }
 
 SBUILD_CHROOT_PREINSTALL_COMMON = " \
-- 
2.39.5

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250114110019.189529-1-srinuvasan.a%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-21 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-14 11:00 [PATCH] meta/recipes-devtools/sbuild-chroot: Use modern python formatting srinuvasan.a via isar-users
2025-01-21 13:58 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox