[elbe-devel] [PATCH 15/21] elbepack: soapclient: make set_pdebuild a method on ElbeSoapClient

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


This is useful functionality that should be usable without going through
"elbe control".
Make it a library function that can be called from other parts of elbe
and call it from "elbe control".

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/control.py | 4 +---
 elbepack/soapclient.py       | 5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 0bcd81e6f515..2980524a3321 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -214,9 +214,7 @@ def _set_orig(client, args):
 @_add_project_dir_argument
 @add_argument('pdebuild_file')
 def _set_pdebuild(client, args):
-    client.service.start_pdebuild(args.project_dir)
-    client.upload_file(client.service.append_pdebuild, args.project_dir, args.pdebuild_file)
-    client.service.finish_pdebuild(args.project_dir, args.profile, args.cross)
+    client.set_pdebuild(args.project_dir, args.profile, args.cross)
 
 
 @add_argument('--cross', dest='cross', action='store_true',
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 10ca007cb3a4..995a6b3a13ca 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -213,3 +213,8 @@ class ElbeSoapClient:
         self.service.start_upload_orig(builddir, os.path.basename(orig_file))
         self.upload_file(self.service.append_upload_orig, builddir, orig_file)
         self.service.finish_upload_orig(builddir)
+
+    def set_pdebuild(self, builddir, pdebuild_file, profile='', cross=False):
+        self.service.start_pdebuild(builddir)
+        self.upload_file(self.service.append_pdebuild, builddir, pdebuild_file)
+        self.service.finish_pdebuild(builddir, profile, cross)

-- 
2.46.0



More information about the elbe-devel mailing list