Package: password-store / 1.7.3-2

gnupg1-support.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 0003deef64e366aafcba078a17d9f37a6678370e Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Sat, 4 Jan 2014 15:05:05 +0000
Subject: Support gnupg1 as an alternative to gnupg2

This also deals with systems where "gpg" is GnuPG 2.

Bug-Debian: http://bugs.debian.org/701845
Forwarded: no
Last-Update: 2019-02-06

Patch-Name: gnupg1-support.patch
---
 src/completion/pass.bash-completion | 4 +++-
 src/completion/pass.fish-completion | 4 +++-
 src/completion/pass.zsh-completion  | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion
index bbe9d0c..5c6a02c 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -72,8 +72,10 @@ _pass_complete_folders () {
 
 _pass_complete_keys () {
 	local IFS=$'\n'
+	local GPG=gpg2
+	which $GPG >/dev/null || GPG=gpg
 	# Extract names and email addresses from gpg --list-keys
-	local keys="$(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')"
+	local keys="$($GPG --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')"
 	COMPREPLY+=($(compgen -W "${keys}" -- ${cur}))
 }
 
diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion
index 8637874..aa509a6 100644
--- a/src/completion/pass.fish-completion
+++ b/src/completion/pass.fish-completion
@@ -32,7 +32,9 @@ function __fish_pass_uses_command
 end
 
 function __fish_pass_print_gpg_keys
-    gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/'
+    set -l gpg gpg2
+    command -sq $gpg; or set gpg gpg
+    $gpg --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/'
 end
 
 function __fish_pass_print
diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion
index 27ce15a..56e1324 100644
--- a/src/completion/pass.zsh-completion
+++ b/src/completion/pass.zsh-completion
@@ -137,8 +137,10 @@ _pass_complete_entries () {
 
 _pass_complete_keys () {
 	local IFS=$'\n'
+	local GPG=gpg2
+	which $GPG >/dev/null || GPG=gpg
 	# Extract names and email addresses from gpg --list-keys
-	_values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')
+	_values 'gpg keys' $($GPG --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')
 }
 
 _pass