fix slight brokenness in %forgesetup error paths

This commit is contained in:
Nicolas Mailhot 2018-01-23 12:47:06 +01:00
parent 51f1c66748
commit c6cdde1b01

View File

@ -75,7 +75,7 @@ if (forgeurl ~= "") then
local forge = string.match(forgeurl, "^[^:]+://([^/]+)/") local forge = string.match(forgeurl, "^[^:]+://([^/]+)/")
if (string.match(forge, "^gitlab[%.-]") or string.match(forge, "[%.-]gitlab[%.]")) then if (string.match(forge, "^gitlab[%.-]") or string.match(forge, "[%.-]gitlab[%.]")) then
forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+") forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+")
if (forgeurl == "") then if (forgeurl == nil) then
if not silent then if not silent then
rpm.expand("%{error:Gitlab URLs must match https://(…[-.])gitlab[-.]…/owner/repo !\\n}") rpm.expand("%{error:Gitlab URLs must match https://(…[-.])gitlab[-.]…/owner/repo !\\n}")
end end
@ -111,7 +111,7 @@ if (forgeurl ~= "") then
end end
if (string.match(forge, "^github[%.-]") or string.match(forge, "[%.-]github[%.]")) then if (string.match(forge, "^github[%.-]") or string.match(forge, "[%.-]github[%.]")) then
forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+") forgeurl = string.match(forgeurl, "https://[^/]+/[^/]+/[^/#?]+")
if (forgeurl == "") then if (forgeurl == nil) then
if not silent then if not silent then
rpm.expand("%{error:GitHub URLs must match https://(…[-.])github[-.]…/owner/repo !\\n}") rpm.expand("%{error:GitHub URLs must match https://(…[-.])github[-.]…/owner/repo !\\n}")
end end
@ -140,7 +140,7 @@ if (forgeurl ~= "") then
end end
if (forge == "code.googlesource.com") then if (forge == "code.googlesource.com") then
forgeurl = string.match(forgeurl, "https://code.googlesource.com/[^#?]*[^/#?]+") forgeurl = string.match(forgeurl, "https://code.googlesource.com/[^#?]*[^/#?]+")
if (forgeurl == "") then if (forgeurl == nil) then
if not silent then if not silent then
rpm.expand("%{error:Googlesource URLs must match https://code.googlesource.com/…/repo !\\n}") rpm.expand("%{error:Googlesource URLs must match https://code.googlesource.com/…/repo !\\n}")
end end