diff --git a/forge.lua b/forge.lua index 96852f7..f396395 100644 --- a/forge.lua +++ b/forge.lua @@ -31,6 +31,9 @@ local function checkforgeurl(url, id, silent) pagure_ns_fork = { pattern = 'https://[^/]+/fork/[^/]+/[^/]+/[^/#?]+', description = 'https://pagure.io/fork/owner/namespace/repo'}, + ["gitea.com"] = { + pattern = 'https://[^/]+/[^/]+/[^/#?]+', + description = 'https://gitea.com/owner/repo'}, github = { pattern = 'https://[^/]+/[^/]+/[^/#?]+', description = 'https://(…[-.])github[-.]…/owner/repo'}, @@ -129,6 +132,11 @@ local function meta(suffix, verbose, informative, silent) repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/[^/]+/([^/?#]+)")}', archivename = "%{owner" .. suffix .. "}-%{namespace" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}", archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" }, + ["gitea.com"] = { + archiveext = "tar.gz", + archivename = "%{fileref" .. suffix .. "}", + archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}", + topdir = "%{repo}" }, github = { archiveext = "tar.gz", archivename = "%{repo" .. suffix .. "}-%{fileref" .. suffix .. "}", @@ -191,6 +199,11 @@ local function meta(suffix, verbose, informative, silent) fileref = string.gsub(rpm.expand(fileref), "/", "-") end fedora.safeset("fileref" .. suffix, fileref, verbose) + elseif (forge == "gitea.com") then + -- Workaround the way gitea mangles /s in ref names + local fileref = ref + fileref = string.gsub(rpm.expand(fileref), "/", "-") + fedora.safeset("fileref" .. suffix, fileref, verbose) elseif (forge == "code.googlesource.com") then if (ref == "%{?version" .. suffix .. "}") then ref = "v" .. ref diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 0108ce9..d91d4ee 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -6,7 +6,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config -Version: 154 +Version: 155 Release: 1%{?dist} # No version specified. License: GPL+ @@ -206,6 +206,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Sat May 23 2020 Nicolas Mailhot - 155-1 +- forge: add gitea support + * Thu Apr 09 2020 Panu Matilainen - 154-1 - Optimize kernel module provides by using a parametric generator