comparison tests/hghave.py @ 29873:80ba176bad62

test-gpg: start gpg-agent by gpg-connect-agent only if GnuPG v2.1+ detected Danek Duvall found that gpg-connect-agent of GnuPG 2.0 never starts gpg-agent daemon. The 2.1 way is documented as "gpg-coonect-agent /bye" [1], which appears to be different from the 2.0 way [2]. [1]: https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html [2]: https://www.gnupg.org/documentation/manuals/gnupg-2.0/Invoking-GPG_002dAGENT.html Since "gpg-agent --daemon" of GnuPG 2.1 never prints environment variables, "eval $(gpg-agent --daemon)" would be valid only for GnuPG < 2.1, and we'll need a different workaround for 2.0. I have no 2.0 environment, I won't implement it.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 29 Aug 2016 22:59:39 +0900
parents b05a3a04f046
children fe81c953f369
comparison
equal deleted inserted replaced
29872:58db005d870e 29873:80ba176bad62
354 return matchoutput('gpg --version 2>&1', br'GnuPG') 354 return matchoutput('gpg --version 2>&1', br'GnuPG')
355 355
356 @check("gpg2", "gpg client v2") 356 @check("gpg2", "gpg client v2")
357 def has_gpg2(): 357 def has_gpg2():
358 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.') 358 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.')
359
360 @check("gpg21", "gpg client v2.1+")
361 def has_gpg21():
362 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)')
359 363
360 @check("unix-permissions", "unix-style permissions") 364 @check("unix-permissions", "unix-style permissions")
361 def has_unix_permissions(): 365 def has_unix_permissions():
362 d = tempfile.mkdtemp(dir='.', prefix=tempprefix) 366 d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
363 try: 367 try: