aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2022-11-20 11:40:39 +0000
committergarret <garret@airmail.cc>2022-11-20 11:40:39 +0000
commitba1a0c8371e3b4478ffb4ba2b0efce099082c78b (patch)
tree6ba5e6b793eadba8dcc51c83cad43b0397b967b0
parent31aac07de77fa38cd8eb3065aa7b57034b951e02 (diff)
downloaddepctrl-feedmaker-ba1a0c8371e3b4478ffb4ba2b0efce099082c78b.tar.gz
depctrl-feedmaker-ba1a0c8371e3b4478ffb4ba2b0efce099082c78b.tar.bz2
depctrl-feedmaker-ba1a0c8371e3b4478ffb4ba2b0efce099082c78b.zip
feedmaker: add knownFeeds support
-rwxr-xr-xmake-feed.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/make-feed.lua b/make-feed.lua
index a28e372..8bb01c2 100755
--- a/make-feed.lua
+++ b/make-feed.lua
@@ -116,13 +116,17 @@ end
local function clean_depctrl(depctrl)
local required = {}
+ local feeds = {}
+ if #depctrl == 0 then return nil end
for _, mod in ipairs(depctrl) do
if type(mod[1]) ~= "string" then mod = mod[1] end
- mod["moduleName"] = mod[1]
+ local modname = mod[1]
+ mod["moduleName"] = modname
mod[1] = nil
table.insert(required, mod)
+ feeds[modname] = mod["feed"]
end
- return required
+ return required, feeds
end
local function make_feed(macros)
@@ -130,7 +134,7 @@ local function make_feed(macros)
dependencyControlFeedFormatVersion = "0.3.0",
name = config.name,
description = config.description,
- knownFeeds = {},
+ knownFeeds = config.knownFeeds,
baseUrl = config.baseUrl,
url = config.url,
maintainer = config.maintainer,
@@ -140,7 +144,10 @@ local function make_feed(macros)
for _, script in ipairs(macros) do
local macro = {url = config.scriptUrl, author = script.author, name = script.name, description = script.description, channels = {}}
local channel_info = {version = script.version, released = script.release, default = true, files = {}}
- channel_info.requiredModules = clean_depctrl(script.depctrl)
+ local requiredModules, feeds = clean_depctrl(script.depctrl)
+ feed.knownFeeds = join_ktables(feed.knownFeeds, feeds)
+
+ channel_info.requiredModules = requiredModules
table.insert(channel_info.files, {name = ".lua", url = config.fileUrl, sha1 = script.sha1})
macro.channels[config.channel] = channel_info
feed.macros[script.namespace] = macro