forge.lua: format forge variables table
This commit is contained in:
parent
6ee060464f
commit
bac2df0ae2
1 changed files with 23 additions and 11 deletions
|
|
@ -117,57 +117,69 @@ local function meta(suffix, verbose, informative, silent)
|
|||
archiveext = "tar.bz2",
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/[^/]+/([^/?#]+)"))}',
|
||||
archivename = "%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
|
||||
topdir = "%{archivename" .. suffix .. "}" },
|
||||
topdir = "%{archivename" .. suffix .. "}",
|
||||
},
|
||||
gitlab = {
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/-/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^?#]+/([^/?#]+)"))}' },
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^?#]+/([^/?#]+)"))}',
|
||||
},
|
||||
pagure = {
|
||||
archiveext = "tar.gz",
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/?#]+)"))}',
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
},
|
||||
pagure_ns = {
|
||||
archiveext = "tar.gz",
|
||||
namespace = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/]+)/[^/?#]+"))}',
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/[^/]+/([^/?#]+)"))}',
|
||||
archivename = "%{namespace" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
},
|
||||
pagure_fork = {
|
||||
archiveext = "tar.gz",
|
||||
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/([^/]+)/[^/?#]+"))}',
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/([^/?#]+)"))}',
|
||||
archivename = "%{owner" .. suffix .. "}-%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
},
|
||||
pagure_ns_fork = {
|
||||
archiveext = "tar.gz",
|
||||
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/([^/]+)/[^/]+/[^/?#]+"))}',
|
||||
namespace = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "https://[^/]+/fork/[^/]+/([^/]+)/[^/?#]+"))}',
|
||||
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 .. "}" },
|
||||
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}" },
|
||||
topdir = "%{repo}",
|
||||
},
|
||||
github = {
|
||||
archiveext = "tar.gz",
|
||||
archivename = "%{repo" .. suffix .. "}-%{fileref" .. suffix .. "}",
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}/%{archivename" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
},
|
||||
["code.googlesource.com"] = {
|
||||
archiveext = "tar.gz",
|
||||
repo = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://.+/([^/?#]+)"))}',
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/+archive/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
topdir = "" },
|
||||
topdir = "",
|
||||
},
|
||||
["bitbucket.org"] = {
|
||||
shortcommit = '%{lua:print(string.sub(rpm.expand("%{commit' .. suffix .. '}"), 1, 12))}',
|
||||
owner = '%{lua:print(string.match(rpm.expand("%{forgeurl' .. suffix .. '}"), "^[^:]+://[^/]+/([^/?#]+)"))}',
|
||||
archivename = "%{owner" .. suffix .. "}-%{repo" .. suffix .. "}-%{shortcommit" .. suffix .. "}",
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/get/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}" },
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/get/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
},
|
||||
sourcehut = {
|
||||
archiveext = "tar.gz",
|
||||
archivename = "%{repo" .. suffix .. "}-%{fileref" .. suffix .. "}",
|
||||
archiveurl = "%{forgeurl" .. suffix .. "}/archive/%{ref" .. suffix .. "}.%{archiveext" .. suffix .. "}",
|
||||
topdir = "%{repo" .. suffix .. "}-%{ref" .. suffix .. "}" } }
|
||||
topdir = "%{repo" .. suffix .. "}-%{ref" .. suffix .. "}",
|
||||
},
|
||||
}
|
||||
-- Packaging a moving branch is quite a bad idea, but since at least Gitlab
|
||||
-- will treat branches and tags the same way better support branches explicitly
|
||||
-- than have packagers hijack %{tag} to download branch states
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue