From 276f3390e18b34e6211b4c75876a0ab4c10a5ac9 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 11 Nov 2020 11:58:28 +0900 Subject: [PATCH] qt: Allow build with older GnuPG (< 2.2.18). * lang/qt/tests/t-remarks.cpp (initTestCase): Check gpg for allow-weak-key-signatures option. Signed-off-by: NIIBE Yutaka --- lang/qt/tests/t-remarks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/qt/tests/t-remarks.cpp b/lang/qt/tests/t-remarks.cpp index 8597372f..c1880a7d 100644 --- a/lang/qt/tests/t-remarks.cpp +++ b/lang/qt/tests/t-remarks.cpp @@ -43,6 +43,7 @@ #include "protocol.h" #include "signkeyjob.h" #include "context.h" +#include "engineinfo.h" #include "t-support.h" @@ -503,7 +504,9 @@ private Q_SLOTS: qputenv("GNUPGHOME", mDir.path().toUtf8()); QFile conf(mDir.path() + QStringLiteral("/gpg.conf")); QVERIFY(conf.open(QIODevice::WriteOnly)); - conf.write("allow-weak-key-signatures"); + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.2.18") { + conf.write("allow-weak-key-signatures"); + } conf.close(); }