From 3490049617875d0bab496591f473d437bbeb4980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 25 Jul 2019 11:14:52 +0200 Subject: [PATCH] Simplify the API of %gpgverify Instead of: %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' It is now possible to do: %gpgverify -k2 -s1 -d0 I haven't yet assumed any defaults not to break backwards compatibility. --- macros.fedora-misc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/macros.fedora-misc b/macros.fedora-misc index 83e455a..467a2fd 100644 --- a/macros.fedora-misc +++ b/macros.fedora-misc @@ -43,4 +43,19 @@ fedora.writevars(macrofile,rpmvars) } # gpgverify verifies signed sources. There is documentation in the script. -%gpgverify %{_rpmconfigdir}/redhat/gpgverify +%gpgverify(k:s:d:) %{lua: +local script = rpm.expand("%{_rpmconfigdir}/redhat/gpgverify ") +local keyring = rpm.expand("%{-k*}") +local signature = rpm.expand("%{-s*}") +local data = rpm.expand("%{-d*}") +print(script) +if keyring ~= "" then + print(rpm.expand("--keyring '%{SOURCE" .. keyring .. "}' ")) +end +if signature ~= "" then + print(rpm.expand("--signature '%{SOURCE" .. signature .. "}' ")) +end +if data ~= "" then + print(rpm.expand("--data '%{SOURCE" .. data .. "}' ")) +end +}