[elbe-devel] [PATCH] elbepack: control: make parameter output of _get_files() optional again

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Aug 2 13:29:26 CEST 2024


This was accidentally made non-optional during the argparse conversion.

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

diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 101c4bdcc0fd..7aede24dbe7c 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -215,7 +215,7 @@ def _dump_file(client, args):
         part = part + 1
 
 
- at add_argument('--output', required=True, help='Output files to <directory>')
+ at add_argument('--output', help='Output files to <directory>')
 @add_argument('--pbuilder-only', action='store_true', dest='pbuilder_only',
               help='Only list/download pbuilder Files')
 @add_argument('--matches', dest='matches', default=False,
@@ -240,10 +240,11 @@ def _get_files(client, args):
         except AttributeError:
             print(f'{f.name}')
 
-        dst = os.path.abspath(args.output)
-        os.makedirs(dst, exist_ok=True)
-        dst_fname = str(os.path.join(dst, os.path.basename(f.name)))
-        client.download_file(args.project_dir, f.name, dst_fname)
+        if args.output:
+            dst = os.path.abspath(args.output)
+            os.makedirs(dst, exist_ok=True)
+            dst_fname = str(os.path.join(dst, os.path.basename(f.name)))
+            client.download_file(args.project_dir, f.name, dst_fname)
 
     if nfiles == 0:
         sys.exit(189)

---
base-commit: 149efadc6da6dbf3b26acc2979f24e173a7bbf2c
change-id: 20240802-get_files-output-fdcd934a7b32

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list