meta/recipes-devtools/sbuild-chroot: Use modern python formatting

Message ID 20250114110019.189529-1-srinuvasan.a@siemens.com
State New
Headers show
Series meta/recipes-devtools/sbuild-chroot: Use modern python formatting | expand

Commit Message

srinuvasan.a Jan. 14, 2025, 11 a.m. UTC
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(-)

Patch

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 = " \