diff options
author | garret <garret@airmail.cc> | 2022-11-28 00:04:20 +0000 |
---|---|---|
committer | garret <garret@airmail.cc> | 2022-11-28 00:04:20 +0000 |
commit | 1a39db987a81fee0bc2e12022630ff68fcb63230 (patch) | |
tree | f9a6cba2af5ce1d8478c9257f9e457c88c017640 /make-feed.lua | |
parent | 4b7c68ef3142801c2284f2ec1bbe8f403e20c39b (diff) | |
download | depctrl-feedmaker-1a39db987a81fee0bc2e12022630ff68fcb63230.tar.gz depctrl-feedmaker-1a39db987a81fee0bc2e12022630ff68fcb63230.tar.bz2 depctrl-feedmaker-1a39db987a81fee0bc2e12022630ff68fcb63230.zip |
feedmaker: define fileBaseUrl per macro
i don't want this and i hope to eventually be able to revert this commit
Diffstat (limited to 'make-feed.lua')
-rwxr-xr-x | make-feed.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/make-feed.lua b/make-feed.lua index 94d9181..554d61e 100755 --- a/make-feed.lua +++ b/make-feed.lua @@ -184,11 +184,14 @@ local function clean_depctrl(depctrl) return required, feeds end -local function get_feed_entry(script) +local function get_feed_entry(script, fileBaseUrl) 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 = {}} local requiredModules, feeds = clean_depctrl(script.depctrl) + macro.fileBaseUrl = fileBaseUrl -- let it be known that i'm not happy about this and i want it gone + -- but depctrl doesn't comply with its own damn spec + channel_info.requiredModules = requiredModules table.insert(channel_info.files, {name = "." .. script.extension, url = config.fileUrl, sha1 = script.sha1}) macro.channels[config.channel] = channel_info @@ -209,9 +212,9 @@ local function make_feed(meta) } if next(meta.macros) then config.macros.ignoreCondition = nil - feed.macros = join_ktables(feed.macros, config.macros) -- remove the ignore functions so they don't cause problems with the json conversion + feed.macros = feed.macros or {} for _, script in ipairs(meta.macros) do - local macro, feeds = get_feed_entry(script) + local macro, feeds = get_feed_entry(script, config.macros.fileBaseUrl) feed.knownFeeds = join_ktables(feed.knownFeeds, feeds) feed.macros[script.namespace] = macro end @@ -219,9 +222,9 @@ local function make_feed(meta) if next(meta.modules) then config.modules.ignoreCondition = nil - feed.modules = join_ktables(feed.modules, config.modules) + feed.modules = feed.modules or {} for _, script in ipairs(meta.modules) do - local mod, feeds = get_feed_entry(script) + local mod, feeds = get_feed_entry(script, config.modules.fileBaseUrl) feed.knownFeeds = join_ktables(feed.knownFeeds, feeds) feed.modules[script.namespace] = mod end |