[bitbake-devel,1/1] bitbake-diffsigs: fix traceback with no arguments

Submitted by Paul Eggleton on April 10, 2017, 10:35 p.m. | Patch ID: 139004


Message ID ca32559f007df35d7c5bbc818c709a305acce406.1491863723.git.paul.eggleton@linux.intel.com
State New
Headers show

Commit Message

Paul Eggleton April 10, 2017, 10:35 p.m.
In the move over to argparse we've made the two signature file arguments
optional and thus if -t is not in use we need to explicitly check if at
least one signature file has been specified - and if not, show an error
and the command-line help.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
 bin/bitbake-diffsigs | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bin/bitbake-diffsigs b/bin/bitbake-diffsigs
index 884be1e..eb2f859 100755
--- a/bin/bitbake-diffsigs
+++ b/bin/bitbake-diffsigs
@@ -147,6 +147,10 @@  else:
             output = bb.siggen.compare_sigfiles(options.sigdatafile1, options.sigdatafile2, color=color)
         elif options.sigdatafile1:
             output = bb.siggen.dump_sigfile(options.sigdatafile1)
+        else:
+            logger.error('Must specify signature file(s) or -t/--task')
+            parser.print_help()
+            sys.exit(1)
     except IOError as e: