[elbe-devel] [PATCH 16/21] elbepack: pbuilder: call set_pdebuild() directly

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Aug 6 11:18:14 CEST 2024


Instead of going through "elbe control", call the set_pdebuild() method
directly. This reuses existing connections and improves the error
reporting.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/pbuilder.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/elbepack/commands/pbuilder.py b/elbepack/commands/pbuilder.py
index 022c34f716a8..0277dd3738b8 100644
--- a/elbepack/commands/pbuilder.py
+++ b/elbepack/commands/pbuilder.py
@@ -88,9 +88,6 @@ def _update(control, args):
 @add_argument('--xmlfile', help='xmlfile to use')
 @add_argument('--project', help='project directory on the initvm')
 def _build(control, args):
-    crossopt = []
-    if args.cross:
-        crossopt = ['--cross']
     tmp = TmpdirFilesystem()
 
     if args.xmlfile:
@@ -130,16 +127,7 @@ def _build(control, args):
     print('Pushing source into pbuilder')
     print('')
 
-    try:
-        run_elbe([
-            'control', 'set_pdebuild',
-            '--profile', args.profile, *crossopt,
-            prjdir, tmp.fname('pdebuild.tar.gz'),
-        ], check=True)
-    except subprocess.CalledProcessError:
-        print('elbe control set_pdebuild Failed', file=sys.stderr)
-        print('Giving up', file=sys.stderr)
-        sys.exit(166)
+    control.set_pdebuild(prjdir, tmp.fname('pdebuild.tar.gz'), args.profile, args.cross)
 
     control.wait_busy(prjdir)
 

-- 
2.46.0



More information about the elbe-devel mailing list