[pass] Override GPG path

Kyle Ondy kyle at ondy.me
Wed Aug 3 16:45:21 CEST 2016


On 16-08-02 17:11, Allen Li wrote:
> Would pass's maintainer/users be open to adding a feature to overriding the
> path to the GnuPG binary?  This does add some complexity, but I think it is
> worth adding, for example if a user needs to use a custom compiled binary
> sitting outside of the PATH.
>
> My own use case is to force pass to use gpg even though gpg2 is installed
> (for other reasons I won't go into), but I think generally being able to
> configure GPG's path is a useful feature to have.
>
> Any thoughts?

Could this be implemented with the following single line change?
This is my first time emailing a patch, so let me know if I didn't do it right.



f the env var `PASSWORD_GPG_PATH` is unset, fallback to the prior logic
for setting GPG path.

Signed-off-by: Kyle Ondy <kyle at ondy.me>
---
 src/password-store.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/password-store.sh b/src/password-store.sh
index 63be840..91d5324 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -12,6 +12,7 @@ export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}"
 which gpg2 &>/dev/null && GPG="gpg2"
 [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" )

+GPG="${PASSWORD_GPG_PATH:-$GPG}"
 PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
 X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}"
 CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}"
-- 
2.7.4


> _______________________________________________
> Password-Store mailing list
> Password-Store at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/password-store

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20160803/4055fae1/attachment.asc>


More information about the Password-Store mailing list