diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -357,6 +357,10 @@ def has_gpg(): def has_gpg2(): return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.') +@check("gpg21", "gpg client v2.1+") +def has_gpg21(): + return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)') + @check("unix-permissions", "unix-style permissions") def has_unix_permissions(): d = tempfile.mkdtemp(dir='.', prefix=tempprefix) diff --git a/tests/test-gpg.t b/tests/test-gpg.t --- a/tests/test-gpg.t +++ b/tests/test-gpg.t @@ -12,11 +12,16 @@ Test the GPG extension $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME $ cp -R "$TESTDIR/gpg" "$GNUPGHOME" -Start gpg-agent, which is required by GnuPG v2, and migrate secret keys +Start gpg-agent, which is required by GnuPG v2 + +#if gpg21 + $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ + > >> $DAEMON_PIDS +#endif + +and migrate secret keys #if gpg2 - $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ - > >> $DAEMON_PIDS $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \ > > /dev/null 2>&1 #endif