The patch's basic idea looks good; thanks. On 05/17/2018 01:46 PM, Bruno Haible wrote:
+gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'` +gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'` +case "$gpg_agent_version" in + 2.*) + case "$gpg_version" in + 1.*)
Maybe not bother to invoke gpg --version unless gpg_agent_version is 2? Also, no need for the sed. Something like this perhaps:
case "`(gpg-agent --version) 2>/dev/null`" in *'(GnuPG) 2.'*) case "`(gpg --version) 2>/dev/null`" in *'(GnuPG) 1.'*) ...