aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2022-12-01 00:12:34 +0000
committergarret <garret@airmail.cc>2023-02-16 05:34:17 +0000
commitd13ae55fd2d4e0d0991da9b01fe01100f714d12c (patch)
tree6164bfa3a833c2b9dc9d90b767502da03d5c5a8d
parent7b74dca5ecb1455ff525bce3b221a81da56a80dc (diff)
downloaddepctrl-feedmaker-d13ae55fd2d4e0d0991da9b01fe01100f714d12c.tar.gz
depctrl-feedmaker-d13ae55fd2d4e0d0991da9b01fe01100f714d12c.tar.bz2
depctrl-feedmaker-d13ae55fd2d4e0d0991da9b01fe01100f714d12c.zip
adapt metadata getters to new sandboxed setup
-rwxr-xr-xmake-feed.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/make-feed.lua b/make-feed.lua
index 0e34fdd..8be2454 100755
--- a/make-feed.lua
+++ b/make-feed.lua
@@ -190,42 +190,42 @@ end
local function get_macro_metadata(file)
local meta = {file = file, name = nil, description = nil, version = nil, author = nil, namespace = nil, depctrl = nil, sha1 = nil, release = nil}
-- having all those nils in the table doesn't really do anything in terms of functionality, but it lets me see what i need to put in it
-
meta.sha1, meta.release = get_file_metadata(file)
meta.basename, meta.extension = split_filename(file)
function include() end -- so it doesnt die with karaskel imports and such
- run_file(file, meta.extension)
+ local macro = run_file(file, meta.extension)
+ if macro == nil then return nil end
- -- script_name etc are now in our global scope
- if config.macros.ignoreCondition() then
+ if config.macros.ignoreCondition(macro) then
err(file .. ": ignored by config, skipping")
return nil
end
- meta.name = script_name
- meta.description = script_description
- meta.version = script_version
- meta.author = script_author
- meta.namespace = script_namespace
- meta.changelog = script_changelog
- meta.depctrl = __feedmaker_version
+ meta.name = macro.script_name
+ meta.description = macro.script_description
+ meta.version = macro.script_version
+ meta.author = macro.script_author
+ meta.namespace = macro.script_namespace
+ meta.changelog = macro.script_changelog
+ meta.depctrl = macro.__feedmaker_version
return meta
end
local function get_module_metadata(file)
+
local meta = {file = file, name = nil, description = nil, version = nil, author = nil, namespace = nil, depctrl = nil, sha1 = nil, release = nil}
meta.sha1, meta.release = get_file_metadata(file)
meta.basename, meta.extension = split_filename(file)
- run_file(file, meta.extension)
-
- if config.modules.ignoreCondition() then
+ local mod = run_file(file, meta.extension)
+ if mod == nil then return nil end
+ if config.modules.ignoreCondition(mod) then
err(file .. ": ignored by config, skipping")
return nil
end
- local depctrl = __feedmaker_version
+ local depctrl = mod.__feedmaker_version
meta.name = depctrl.name
meta.version = depctrl.version
meta.author = depctrl.author