← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~knitzsche/apport/catch-invalid-arg-combo into lp:apport

 

Kyle Nitzsche has proposed merging lp:~knitzsche/apport/catch-invalid-arg-combo into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)

For more details, see:
https://code.launchpad.net/~knitzsche/apport/catch-invalid-arg-combo/+merge/136838

On apport-retrace, using -C argument without -S argument does not make sense, since the cache is only used when creating a sandbox. 

This catches this arg combination, warns user, and exits.

-- 
https://code.launchpad.net/~knitzsche/apport/catch-invalid-arg-combo/+merge/136838
Your team Apport upstream developers is requested to review the proposed merge of lp:~knitzsche/apport/catch-invalid-arg-combo into lp:apport.
=== modified file 'bin/apport-retrace'
--- bin/apport-retrace	2012-10-19 03:53:58 +0000
+++ bin/apport-retrace	2012-11-29 03:39:20 +0000
@@ -79,6 +79,12 @@
         optparser.error(_('incorrect number of arguments; use --help for a short help'))
         sys.exit(1)
 
+# catch invalid useage of -C without -S (cache is only used when making a
+# sandbox)
+    if opts.cache and not opts.sandbox:
+        optparser.error( _('You cannot use -C without -S. Stopping.'))
+        sys.exit(1)
+
     if not (opts.auth or opts.output or opts.stdout or opts.gdb):
         optparser.error(_('you either need to do a local operation (-s, -g, -o) or supply an authentication file (--auth); see --help for a short help'))
         sys.exit(1)