From 455084c511e23fbef6a0732a9c2f4ebc76fde642 Mon Sep 17 00:00:00 2001 From: Nicolas Mailhot Date: Tue, 6 Nov 2018 17:47:28 +0100 Subject: [PATCH] forge: add more distprefix cleaning (bz1646724) --- forge.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forge.lua b/forge.lua index a812184..af71c87 100644 --- a/forge.lua +++ b/forge.lua @@ -194,12 +194,13 @@ local function forgemeta(suffix, verbose, informative, silent) -- dist processing (computing the correct prefix for snapshots) local distprefix = "" if not isrelease then - distprefix = rpm.expand(ref) + distprefix = string.lower(rpm.expand(ref)) if (ref == "%{?commit" .. suffix .. "}") then distprefix = string.sub(distprefix, 1, 7) elseif (ref ~= "%{?branch" .. suffix .. "}") then distprefix = string.gsub(distprefix, "[%p%s]+", ".") - local v = string.gsub(spec["version"], "[%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 distprefix = getversionsuffix(distprefix, p .. v) end