]> git.pld-linux.org Git - packages/gnupg2.git/commitdiff
- drop broken X11 detection logic from gnupg-agent.sh
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 15 Oct 2015 18:06:34 +0000 (20:06 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 18 Oct 2016 20:22:21 +0000 (22:22 +0200)
Out pinentry is a script that does the right thing, and this should just
work without the need to edit some, totally undocumented, configs.

gnupg-agent.sh

index ce450c5e0529b2829f248bf02dfeac53f6f4aaf3..1b3fa5a9c08719b44addcd9397ac368820ffbb4c 100644 (file)
@@ -6,28 +6,23 @@ else
     CFG="${HOME}/.gnupg/options"
 fi
 
-X11=no
 seahorse=no
 if [ -r "${HOME}/.gnupg/gpg-agent.conf" ]; then
-    grep -qE "^[[:blank:]]*pinentry-program[[:blank:]]*.*pinentry-(qt|qt4|gtk)" "${HOME}/.gnupg/gpg-agent.conf" && X11=yes
-    grep -qE "^[[:blank:]]*pinentry-program[[:blank:]]*.*seahorse-agent" "${HOME}/.gnupg/gpg-agent.conf" && X11=yes && seahorse=yes
+    grep -qE "^[[:blank:]]*pinentry-program[[:blank:]]*.*seahorse-agent" "${HOME}/.gnupg/gpg-agent.conf" && seahorse=yes
 fi
 
 if grep -q "^[[:blank:]]*use-agent" ${CFG} 2>/dev/null; then
     if [ -f "${HOME}/.gnupg/GPG_AGENT_INFO" ] && pid="$(cut -d: -f2 $HOME/.gnupg/GPG_AGENT_INFO)" && [ -n "$pid" ] && kill -0 "$pid"  2>/dev/null; then
        export GPG_AGENT_INFO="$(cat ${HOME}/.gnupg/GPG_AGENT_INFO)"
     else
-       if [ -n "$DISPLAY" -a "$X11" = "yes" ] || [ -z "$DISPLAY" -a "$X11" = "no" ]; then
-            if [ "$seahorse" = "no" ]; then
-                eval "$(gpg-agent --daemon)"
-            else
-                eval "$(seahorse-agent --variables)"
-            fi
-           echo $GPG_AGENT_INFO > ~/.gnupg/GPG_AGENT_INFO
-           export GPG_AGENT_INFO
+       if [ "$seahorse" = "no" ]; then
+           eval "$(gpg-agent --daemon)"
+       else
+           eval "$(seahorse-agent --variables)"
        fi
+       echo $GPG_AGENT_INFO > ~/.gnupg/GPG_AGENT_INFO
+       export GPG_AGENT_INFO
     fi
 fi
-unset X11
 unset CFG
 unset pid
This page took 0.298288 seconds and 4 git commands to generate.