summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-07-16 09:52:34 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-07-16 10:16:32 +0300
commit7b30db8dc846c36f3d2d7e6ed0e1f396b6ba3885 (patch)
treee88b364278a148a1a4844c3a549cb4706b372641 /src
parent2a25a595ce90e95edd2a4127a8c7f320d94ddaaf (diff)
downloadapk-tools-7b30db8dc846c36f3d2d7e6ed0e1f396b6ba3885.tar.gz
apk-tools-7b30db8dc846c36f3d2d7e6ed0e1f396b6ba3885.tar.bz2
apk-tools-7b30db8dc846c36f3d2d7e6ed0e1f396b6ba3885.tar.xz
apk-tools-7b30db8dc846c36f3d2d7e6ed0e1f396b6ba3885.zip
genhelp: improve to work with lua 5.1
Fix the script to not contain \x00 escape which was the only new feature used. Fix the meson build script to use given lua interpreter for running the genhelp.lua. Based on patch from Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'src')
-rw-r--r--src/genhelp.lua10
-rw-r--r--src/meson.build4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/genhelp.lua b/src/genhelp.lua
index 06a3590..217ec1b 100644
--- a/src/genhelp.lua
+++ b/src/genhelp.lua
@@ -198,12 +198,12 @@ end
function scdoc:render_optgroups(out)
for _, options in ipairs(self.optgroup) do
if #options > 0 then
- table.insert(out, options.name .. "\x00")
+ table.insert(out, options.name .. "\0")
self:render_options(out, options)
if options.name == self.applet then
self:render_footer(out)
end
- table.insert(out, "\x00")
+ table.insert(out, "\0")
end
end
end
@@ -216,7 +216,7 @@ function scdoc:render(out)
local width = self.width
if not self.applet then return end
- table.insert(out, self.applet .. "\x00")
+ table.insert(out, self.applet .. "\0")
table.insert(out, table.concat(self.usage, "\n"))
table.insert(out, "\n")
if #self.commands > 0 then
@@ -239,7 +239,7 @@ function scdoc:render(out)
if self.manpage == "apk" then self:render_footer(out)
else table.insert(out, "\n") end
end
- table.insert(out, "\x00")
+ table.insert(out, "\0")
end
local function compress(data)
@@ -293,7 +293,7 @@ local out = {}
for _, doc in ipairs(f) do doc:render(out) end
for _, doc in ipairs(f) do doc:render_optgroups(out) end
-table.insert(out, "\x00")
+table.insert(out, "\0")
local help = table.concat(out)
--io.stderr:write(help)
diff --git a/src/meson.build b/src/meson.build
index b744a1a..d7c64f4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -78,14 +78,14 @@ apk_src = [
]
if lua_bin.found()
- genhelp_script = find_program('./genhelp.lua')
+ genhelp_script = files('genhelp.lua')
generated_help = custom_target(
'help.h',
capture: true,
output: 'help.h',
input: man_files,
- command: [genhelp_script, '@INPUT@'],
+ command: [lua_bin, genhelp_script, '@INPUT@'],
)
else
generated_help = custom_target(