[elbe-devel] [PATCH 06/11] elbepack: introduce run_elbe helper

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Mar 13 16:54:55 CET 2024


This helper implements the common pattern of reexecuting elbe from
itself.

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

diff --git a/elbepack/directories.py b/elbepack/directories.py
index 2926c4f1c9f7..2501ff6e21af 100644
--- a/elbepack/directories.py
+++ b/elbepack/directories.py
@@ -4,6 +4,8 @@
 
 import __main__
 import os
+import subprocess
+import sys
 from pkgutil import iter_modules
 
 import elbepack
@@ -25,3 +27,7 @@ mako_template_dir = os.path.join(pack_dir, 'makofiles')
 
 default_preseed_fname = os.path.join(pack_dir, 'default-preseed.xml')
 xsdtoasciidoc_mako_fname = os.path.join(pack_dir, 'xsdtoasciidoc.mako')
+
+
+def run_elbe(args, **kwargs):
+    return subprocess.run([sys.executable, elbe_exe, *args], **kwargs)

-- 
2.44.0



More information about the elbe-devel mailing list