[packages/gnupg2] - drop broken X11 detection logic from gnupg-agent.sh

baggins baggins at pld-linux.org
Thu Oct 15 20:08:06 CEST 2015


commit 9594d542831d709aa5c82ff35ea5b19a46df02c4
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Oct 15 20:06:34 2015 +0200

    - drop broken X11 detection logic from gnupg-agent.sh
    
    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 | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/gnupg-agent.sh b/gnupg-agent.sh
index ce450c5..1b3fa5a 100644
--- a/gnupg-agent.sh
+++ b/gnupg-agent.sh
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gnupg2.git/commitdiff/9594d542831d709aa5c82ff35ea5b19a46df02c4



More information about the pld-cvs-commit mailing list