--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net-misc/keychain/files/keychain-2.7.0-fix-pinentry.patch Mon Aug 30 15:17:00 2010 +0200
@@ -0,0 +1,21 @@
+diff -Nur keychain-2.7.0/keychain.sh keychain-2.7.0-b/keychain.sh
+--- keychain-2.7.0/keychain.sh 2009-10-23 22:23:07.000000000 +0200
++++ keychain-2.7.0-b/keychain.sh 2010-04-11 22:58:25.570963964 +0200
+@@ -767,6 +767,8 @@
+ gpg_listmissing() {
+ unset glm_missing
+
++ GPG_TTY=`tty`
++
+ # Parse $gpgkeys into positional params to preserve spaces in filenames
+ set -f # disable globbing
+ glm_IFS="$IFS" # save current IFS
+@@ -778,7 +780,7 @@
+
+ for glm_k in "$@"; do
+ # Check if this key is known to the agent. Don't know another way...
+- if echo | env -i PATH="$PATH" GPG_AGENT_INFO="$GPG_AGENT_INFO" \
++ if echo | env -i GPG_TTY="$GPG_TTY" PATH="$PATH" GPG_AGENT_INFO="$GPG_AGENT_INFO" \
+ gpg --no-options --use-agent --no-tty --sign --local-user "$glm_k" -o- >/dev/null 2>&1; then
+ # already know about this key
+ mesg "Known gpg key: ${CYANN}${glm_k}${OFF}"