@@ -14,11 +14,11 @@ checkengines = {"xetex"}
1414stdengine = " xetex"
1515
1616checkconfigs = {
17- " build" ,
18- " test/config-crossref" ,
19- " test/config-nomencl" ,
20- " test/config-bibtex" ,
21- " test/config-biblatex" ,
17+ " build" ,
18+ " test/config-crossref" ,
19+ " test/config-nomencl" ,
20+ " test/config-bibtex" ,
21+ " test/config-biblatex" ,
2222}
2323
2424typesetexe = " xelatex"
@@ -35,30 +35,31 @@ function update_tag(file, content, tagname, tagdate)
3535 local date = string.gsub (tagdate , " %-" , " /" )
3636
3737 content = string.gsub (content ,
38- " Copyright %(C%) (%d%d%d%d)%-%d%d%d%d" ,
39- " Copyright (C) %1-" .. os.date (" %Y" ))
38+ " Copyright %(C%) (%d%d%d%d)%-%d%d%d%d" ,
39+ " Copyright (C) %1-" .. os.date (" %Y" ))
4040
4141 if string.match (file , " %.cls$" ) then
42- content = string.gsub (content , " \\ newcommand\\ ustcthesisversion{[0-9. ]+" ,
42+ content = string.gsub (content , " \\ newcommand\\ ustcthesisversion{[0-9a-z.- ]+" ,
4343 " \\ newcommand\\ ustcthesisversion{" .. tagname )
4444
4545 content = string.gsub (content , " \\ ProvidesClass{ustcthesis}%[%d%d%d%d/%d%d/%d%d" ,
4646 " \\ ProvidesClass{ustcthesis}[" .. date )
4747
4848 elseif string.match (file , " %-doc.tex" ) then
49- content = string.gsub (content , " v[0-9. ]+\\ qquad %d%d%d%d%-%d%d%-%d%d" ,
49+ content = string.gsub (content , " v[0-9a-z.- ]+\\ qquad %d%d%d%d%-%d%d%-%d%d" ,
5050 " v" .. tagname .. " \\ qquad " .. tagdate )
5151
5252 elseif string.match (file , " CHANGELOG.md" ) then
53- local previous = string.match (content , " /compare/v(.* )%.%.%.HEAD" )
53+ local previous = string.match (content , " /compare/v([0-9a-z.-]+ )%.%.%.HEAD" )
5454 if tagname == previous then return content end
5555 content = string.gsub (content ,
5656 " ## %[Unreleased%]" ,
57- " ## [Unreleased]\n\n ## [" .. tagname .. " ] - " .. tagdate )
57+ " ## [Unreleased]\n\n ## [" .. tagname .. " ] - " .. tagdate )
58+
5859 content = string.gsub (content ,
59- previous .. " %.%.%.HEAD" ,
60+ previous : gsub ( " %. " , " %%. " ): gsub ( " %- " , " %%- " ) .. " %.%.%.HEAD" ,
6061 tagname .. " ...HEAD\n [" .. tagname .. " ]: " .. url .. " /compare/v"
61- .. previous .. " ...v" .. tagname )
62+ .. previous .. " ...v" .. tagname )
6263 end
6364 return content
6465end
0 commit comments