-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.lua
44 lines (35 loc) · 1.1 KB
/
build.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env texlua
-- Build script for "etoolbox" files
-- Identify the bundle and module
bundle = ""
module = "etoolbox"
-- Install .def files as well as .sty
-- These are also the sources
installfiles = {"*.def", "*.sty"}
sourcefiles = installfiles
-- Documentation is standalone
typesetfiles = {"*.tex"}
-- No packed source files
unpackfiles = {}
-- Release a TDS-style zip
packtdszip = true
-- Only need one test run
checkengines = {"pdftex"}
-- Detail how to set the version automatically
tagfiles = {"*.def", "*.sty", "*.tex"}
function update_tag(file,content,tagname,tagdate)
local tagdate = string.gsub(tagdate,"%-","/")
if string.match(file,"%.sty") or string.match(file,"%.def") then
return string.gsub(content,
"\n %[%d%d%d%d/%d%d/%d%d v%d%.%d%w?",
"\n [" .. tagdate .. " v" .. tagname)
elseif string.match(file,"%.tex") then
content = string.gsub(content,
"\n date=%{%d%d%d%d/%d%d/%d%d%}",
"\n date={" .. tagdate .. "}")
return string.gsub(content,
"\n revision=%{v%d%.%d%w?%}",
"\n revision={v" .. tagname .. "}")
end
return content
end