diff options
| author | Michael Forney <mforney@mforney.org> | 2017-09-24 12:04:42 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-09-25 19:23:06 -0700 |
| commit | 86595977d761baa67c1462efd59a6404b56205ad (patch) | |
| tree | 515fbfbb2154f288e53eb3a94b6191b7e1d95b57 /pkg/tz/tzdata.lua | |
| parent | ba94a8513d9a0aadb3f2c834c74b64aa644c61e8 (diff) | |
tz: Write tzdata hash script in lua
This should make it easier to support the users `config.fs`.
Diffstat (limited to 'pkg/tz/tzdata.lua')
| -rw-r--r-- | pkg/tz/tzdata.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/tz/tzdata.lua b/pkg/tz/tzdata.lua new file mode 100644 index 00000000..4de07e82 --- /dev/null +++ b/pkg/tz/tzdata.lua @@ -0,0 +1,18 @@ +local cmd = 'rc ./scripts/hash.rc %s %s share/zoneinfo/%s %s' + +repo = arg[1] +outdir = arg[2] +for i = 3, #arg do + 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 + os.execute(cmd:format(repo, 120000, name, target)) + else + name = line:match('^Zone%s+(%g+)') + if name then + os.execute(cmd:format(repo, 100644, name, outdir..'/'..name)) + end + end + end +end |
