From 7b6ec4668c2c8b4b52694619caf4909d8ecda382 Mon Sep 17 00:00:00 2001 From: Nicolas Mailhot Date: Sun, 11 Nov 2018 17:41:48 +0100 Subject: [PATCH] forge: fix handling of / in refs as showcased by github.com/dnstap/golang-dnstap --- forge.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/forge.lua b/forge.lua index 04a543d..bcfe01f 100644 --- a/forge.lua +++ b/forge.lua @@ -143,6 +143,8 @@ local function forgemeta(suffix, verbose, informative, silent) elseif (fileref ~= "%{?commit" .. suffix .. "}") and string.match(rpm.expand(fileref), "^v[%d]") then fileref = string.gsub(rpm.expand(fileref), "^v", "") + elseif (string.match(rpm.expand(fileref), "/")) then + fileref = string.gsub(rpm.expand(fileref), "/", "-") end fedora.safeset("fileref" .. suffix, fileref, verbose) elseif (forge == "code.googlesource.com") then @@ -201,7 +203,7 @@ local function forgemeta(suffix, verbose, informative, silent) distprefix = string.gsub(distprefix, "[%p%s]+", ".") distprefix = string.gsub(distprefix, "^" .. string.lower(rpm.expand("%{?repo}")) .. "%.?", "") local v = string.gsub(rpm.expand("%{version}"), "[%p%s]+", ".") - for _, p in ipairs({'','v','v.','version','version.'}) do + for _, p in ipairs({'','v','v.','version','version.','tags.v', 'tags.v.'}) do distprefix = getversionsuffix(distprefix, p .. v) end distprefix = string.gsub(distprefix, "^%.", "")