From b6f7d1be6c9b58ca6bcd5a12f72652977d3935ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 30 Jun 2016 08:19:23 +0200 Subject: [PATCH] explicit "osc add" of a directory offers to create an archive for uploading it Question: what can be a trigger to update it? checking for mtimes in directories where an .obscpio exists? --- NEWS | 2 ++ osc/commandline.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 684921dd..e7d9ddc2 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ - osc service runall: runs all service local, independend of the mode This allows to create local files even when disabled or just created at buildtime + - support snapcraft.yaml build descriptions + - "osc add" of a directory offers to create an archive for uploading it 0.154 - switch to new obs_scm service when adding git URL's diff --git a/osc/commandline.py b/osc/commandline.py index a52530f1..1ae73ba0 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -4436,8 +4436,17 @@ Please submit there instead, or use --nodevelproject to force direct submission. addGitSource(arg) else: addDownloadUrlService(arg) - else: - addFiles([arg]) + continue + if os.path.isdir(arg): + resp = raw_input("%s is a directory, do you want to archive it for submission? (y/n)" % (arg)) + if resp not in ('y', 'Y'): + continue + archive = ("%s.obscpio" % arg) + run_external("find %s | cpio -o -H newc > %s" % (arg, archive), shell=True) + addFiles([archive]) + continue + + addFiles([arg]) def do_mkpac(self, subcmd, opts, *args):