[elbe-devel] [PATCH 42/75] debpkg: use f-strings

Daniel Braunwarth daniel at braunwarth.dev
Wed Nov 2 20:01:52 CET 2022


Signed-off-by: Daniel Braunwarth <daniel at braunwarth.dev>
---
 elbepack/debpkg.py | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/elbepack/debpkg.py b/elbepack/debpkg.py
index a6c58531d..4e21865c0 100644
--- a/elbepack/debpkg.py
+++ b/elbepack/debpkg.py
@@ -52,10 +52,10 @@ def build_binary_deb(
     # pylint: disable=too-many-arguments
 
     tmpdir = mkdtemp()
-    pkgfname = "%s_%s_%s" % (name, version, arch)
+    pkgfname = f"{name}_{version}_{arch}"
     pkgdir = os.path.join(tmpdir, pkgfname)
 
-    os.system('mkdir -p "%s"' % os.path.join(pkgdir, "DEBIAN"))
+    os.system(f'mkdir -p "{os.path.join(pkgdir, "DEBIAN")}"')
     write_file(
         os.path.join(
             pkgdir,
@@ -71,19 +71,12 @@ def build_binary_deb(
 
     for (fname, instpath) in files:
         full_instpath = os.path.join(pkgdir, instpath)
-        os.system('mkdir -p "%s"' % full_instpath)
-        os.system('cp -a "%s" "%s"' % (fname, full_instpath))
-
-    os.system('dpkg-deb --build "%s"' % pkgdir)
+        os.system(f'mkdir -p "{full_instpath}"')
+        os.system(f'cp -a "{fname}" "{full_instpath}"')
 
+    os.system(f'dpkg-deb --build "{pkgdir}"')
     os.system(
-        'cp -v "%s" "%s"' %
-        (os.path.join(
-            tmpdir,
-            pkgfname +
-            ".deb"),
-            target_dir))
-
-    os.system('rm -r "%s"' % tmpdir)
+        f'cp -v "{os.path.join(tmpdir, pkgfname + ".deb")}" "{target_dir}"')
+    os.system(f'rm -r "{tmpdir}"')
 
     return pkgfname + ".deb"
-- 
2.38.1



More information about the elbe-devel mailing list