← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~ed.so/duplicity/gpg.binary into lp:duplicity

 

edso has proposed merging lp:~ed.so/duplicity/gpg.binary into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~ed.so/duplicity/gpg.binary/+merge/262540

new parameter --gpg-binary allows user to point to a different gpg binary, not necessarily in path
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/gpg.binary into lp:duplicity.
=== modified file 'bin/duplicity.1'
--- bin/duplicity.1	2015-06-14 12:46:53 +0000
+++ bin/duplicity.1	2015-06-21 15:29:11 +0000
@@ -523,6 +523,13 @@
 Other languages may require a different mailbox than the default.
 
 .TP
+.BI "--gpg-binary " file_path
+Allows you to force duplicity to use 
+.I file_path
+as gpg command line binary. Can be an absolute or relative file path or a file name.
+Default value is 'gpg'. The binary will be localized via the PATH environment variable.
+
+.TP
 .BI "--gpg-options " options
 Allows you to pass options to gpg encryption.  The
 .I options

=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py	2015-05-08 12:28:47 +0000
+++ duplicity/commandline.py	2015-06-21 15:29:11 +0000
@@ -396,6 +396,8 @@
                       callback=lambda o, s, v, p: (setattr(p.values, o.dest, True),
                                                    old_fn_deprecation(s)))
 
+    parser.add_option("--gpg-binary", type="file", metavar=_("path"))
+
     parser.add_option("--gpg-options", action="extend", metavar=_("options"))
 
     # TRANSL: Used in usage help to represent an ID for a hidden GnuPG key. Example:

=== modified file 'duplicity/globals.py'
--- duplicity/globals.py	2015-05-08 12:28:47 +0000
+++ duplicity/globals.py	2015-06-21 15:29:11 +0000
@@ -79,6 +79,8 @@
 # source directory.
 select = None
 
+gpg_binary = None
+
 # Set to GPGProfile that will be used to compress/uncompress encrypted
 # files.  Replaces encryption_keys, sign_key, and passphrase settings.
 gpg_profile = None

=== modified file 'duplicity/gpg.py'
--- duplicity/gpg.py	2015-02-01 17:37:37 +0000
+++ duplicity/gpg.py	2015-06-21 15:29:11 +0000
@@ -114,6 +114,9 @@
 
         # Start GPG process - copied from GnuPGInterface docstring.
         gnupg = gpginterface.GnuPG()
+        # overrides default gpg binary 'gpg'
+        if globals.gpg_binary is not None:
+            gnupg.call = globals.gpg_binary
         gnupg.options.meta_interactive = 0
         gnupg.options.extra_args.append('--no-secmem-warning')
         if globals.use_agent:


Follow ups