|
|
@ -201,16 +201,16 @@ def get_gnupg_components(sp=subprocess):
|
|
|
|
def get_gnupg_binary(sp=subprocess, neopg_binary=None):
|
|
|
|
def get_gnupg_binary(sp=subprocess, neopg_binary=None):
|
|
|
|
"""Starting GnuPG 2.2.x, the default installation uses `gpg`."""
|
|
|
|
"""Starting GnuPG 2.2.x, the default installation uses `gpg`."""
|
|
|
|
if neopg_binary:
|
|
|
|
if neopg_binary:
|
|
|
|
return [neopg_binary]
|
|
|
|
return neopg_binary
|
|
|
|
return [get_gnupg_components(sp=sp)['gpg']]
|
|
|
|
return get_gnupg_components(sp=sp)['gpg']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def gpg_command(args, env=None):
|
|
|
|
def gpg_command(args, env=None):
|
|
|
|
"""Prepare common GPG command line arguments."""
|
|
|
|
"""Prepare common GPG command line arguments."""
|
|
|
|
if env is None:
|
|
|
|
if env is None:
|
|
|
|
env = os.environ
|
|
|
|
env = os.environ
|
|
|
|
cmd = get_gnupg_binary(neopg_binary=env.get('NEOPG_BINARY')).copy()
|
|
|
|
cmd = get_gnupg_binary(neopg_binary=env.get('NEOPG_BINARY'))
|
|
|
|
return cmd + args
|
|
|
|
return [cmd] + args
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_keygrip(user_id, sp=subprocess):
|
|
|
|
def get_keygrip(user_id, sp=subprocess):
|
|
|
|