Files
oasis-linux-mirror/pkg/tz/tzdata.lua
T
Michael Forney 741d252822 Port build scripts to POSIX shell
Since we are now using Lua to generate ninja files, use of rc in build scripts
seems unnecessary and adds an additional bootstrap dependency. None of them are
too fancy, so just port to POSIX sh instead.
2018-02-16 02:52:34 -08:00

25 lines
644 B
Lua

local function execute(cmd)
if not os.execute(cmd) then
error('command failed: '..cmd)
end
end
local hash = 'sh ./scripts/hash.sh %s %s share/zoneinfo/%s %s'
local repo = arg[1]
local outdir = arg[2]
for i = 3, #arg do
execute(string.format('zic -d %s %s', outdir, arg[i]))
for line in io.lines(arg[i]) do
local target, name = line:match('^Link%s+(%g+)%s+(%g+)')
if target then
target = name:gsub('[^/]+', '..'):sub(1, -3)..target
execute(hash:format(repo, 120000, name, target))
else
name = line:match('^Zone%s+(%g+)')
if name then
execute(hash:format(repo, 100644, name, outdir..'/'..name))
end
end
end
end