commit 84deab2
hovercats
·
2024-02-08 22:45:47 +0000 UTC
parent 325a52f
sync with upstream: replace tail component of src with srcsection in man()
2 files changed,
+12,
-7
+11,
-6
1@@ -486,15 +486,20 @@ end
2
3 function man(srcs, section)
4 for _, src in ipairs(srcs) do
5+ local out = src..'.gz'
6 if not src:match('^[$/]') then
7 src = '$srcdir/'..src
8+ out = '$outdir/'..out
9 end
10- local srcsection = section or src:match('[^.]*$')
11- local i = src:find('/', 1, true)
12- local j = src:reverse():find('.', 1, true)
13- local gz = '$outdir'..src:sub(i, #src - j + 1)..srcsection..'.gz'
14- build('gzip', gz, src)
15- file('share/man/man'..srcsection..'/'..gz:match('[^/]*$'), '644', gz)
16+
17+ local base = src:match('[^/]*$')
18+ local ext = base:match('%.([^.]*)$')
19+ if section then
20+ if ext then base = base:sub(1, -(#ext + 2)) end
21+ ext = section
22+ end
23+ build('gzip', out, src)
24+ file('share/man/man'..ext..'/'..base..'.'..ext, '644', out)
25 end
26 end
27
+1,
-1
1@@ -27,7 +27,7 @@ lib('libtinyalsa.a', [[
2
3 for _, tool in ipairs{'tinycap', 'tinymix', 'tinypcminfo', 'tinyplay'} do
4 file('bin/'..tool, '755', exe(tool, {'utils/'..tool..'.c', 'libtinyalsa.a'}))
5- man{'$srcdir/utils/'..tool..'.1'}
6+ man{'utils/'..tool..'.1'}
7 end
8
9 fetch 'git'