From c6cdde1b01abb9b978ec867bf4ae18c0f1c85ea0 Mon Sep 17 00:00:00 2001 From: Nicolas Mailhot Date: Tue, 23 Jan 2018 12:47:06 +0100 Subject: [PATCH] fix slight brokenness in %forgesetup error paths --- macros.forge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macros.forge b/macros.forge index 5be0ac1..426dc03 100644 --- a/macros.forge +++ b/macros.forge @@ -75,7 +75,7 @@ if (forgeurl ~= "") then local forge = string.match(forgeurl, "^[^:]+://([^/]+)/") if (string.match(forge, "^gitlab[%.-]") or string.match(forge, "[%.-]gitlab[%.]")) then forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+") - if (forgeurl == "") then + if (forgeurl == nil) then if not silent then rpm.expand("%{error:Gitlab URLs must match https://(…[-.])gitlab[-.]…/owner/repo !\\n}") end @@ -111,7 +111,7 @@ if (forgeurl ~= "") then end if (string.match(forge, "^github[%.-]") or string.match(forge, "[%.-]github[%.]")) then forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+") - if (forgeurl == "") then + if (forgeurl == nil) then if not silent then rpm.expand("%{error:GitHub URLs must match https://(…[-.])github[-.]…/owner/repo !\\n}") end @@ -140,7 +140,7 @@ if (forgeurl ~= "") then end if (forge == "code.googlesource.com") then forgeurl = string.match(forgeurl, "https://code.googlesource.com/[^#?]*[^/#?]+") - if (forgeurl == "") then + if (forgeurl == nil) then if not silent then rpm.expand("%{error:Googlesource URLs must match https://code.googlesource.com/…/repo !\\n}") end