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

2016-10-18 Thread baggins
commit f14a8ec19f6dfd12e8ac71b48005d5ea0e263f31
Author: Jan Rękorajski 
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/35b4bfec3cde3f52fcdc76c1f6514ed449314cc2

___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


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

2015-10-15 Thread baggins
commit 9594d542831d709aa5c82ff35ea5b19a46df02c4
Author: Jan Rękorajski 
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

___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit