[elbe-devel] [PATCH 2/7] elbepack: efilesystem: switch chroot() calls to non-shell

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Apr 30 09:23:09 CEST 2024


Running commands through a shell is error-prone.
Migrate all shell-based invocations to normal ones.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/efilesystem.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 93b090946752..bf3020673d61 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -150,11 +150,11 @@ def extract_target(src, xml, dst, cache):
                 ui = '/usr/bin/' + str(xml.defs['userinterpr'])
             do(f"cp {ui} {dst.fname('usr/bin')}")
 
-        cmds = ['--clear-selections',
-                f'--set-selections < {dst.fname(psel)}',
-                '--purge -a']
+        cmds = [['--clear-selections'],
+                ['--set-selections', dst.fname(psel)],
+                ['--purge', '-a']]
         for cmd in cmds:
-            chroot(dst.path, f'/usr/bin/dpkg {cmd}')
+            chroot(dst.path, ['/usr/bin/dpkg', *cmd])
 
 
 class ElbeFilesystem(Filesystem):

-- 
2.44.0



More information about the elbe-devel mailing list