[latex3-commits] [latex3/l3build] main: Update copyright automatically when updating tag (5c2faeb)

github at latex-project.org github at latex-project.org
Mon Dec 18 09:20:50 CET 2023


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/5c2faebff03a40f9a175ee63f46f319bebe29995

>---------------------------------------------------------------

commit 5c2faebff03a40f9a175ee63f46f319bebe29995
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Fri Dec 15 04:16:31 2023 +0800

    Update copyright automatically when updating tag


>---------------------------------------------------------------

5c2faebff03a40f9a175ee63f46f319bebe29995
 build.lua | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/build.lua b/build.lua
index b8ac3ba..54efe26 100644
--- a/build.lua
+++ b/build.lua
@@ -18,7 +18,14 @@ sourcefiles  = {"*.dtx", "l3build*.lua", "*.ins"}
 typesetruns  = 4
 typesetcmds  = "\\AtBeginDocument{\\DisableImplementation}"
 unpackdeps   = { }
-tagfiles     = {"l3build.1", "l3build.dtx", "*.md", "l3build.lua"}
+tagfiles     = {
+  "l3build.1",
+  "l3build.dtx",
+  "l3build.ins",
+  "**/*.md",     -- to include README.md in ./examples
+  "l3build*.lua",
+  "**/regression-test.cfg"
+}
 
 uploadconfig = {
   author      = "The LaTeX Team",
@@ -42,6 +49,21 @@ Linux, macOS, and Windows systems. The package offers:
 function update_tag(file,content,tagname,tagdate)
   local iso = "%d%d%d%d%-%d%d%-%d%d"
   local url = "https://github.com/latex3/l3build/compare/"
+  -- update copyright
+  -- copied from https://github.com/latex3/latex3/blob/76104b03a42246726556384f2ca34083bc6955aa/build-config.lua#L48-L60
+  if string.match(content,"%(C%)%s*[%d%-,]+ The LaTeX Project") then
+    local year = os.date("%Y")
+    content = string.gsub(content,
+      "%(C%)%s*([%d%-,]+) The LaTeX Project",
+      "(C) %1," .. year .. " The LaTeX Project")
+    content = string.gsub(content,year .. "," .. year,year)
+    content = string.gsub(content,
+      "%-" .. math.tointeger(year - 1) .. "," .. year,
+      "-" .. year)
+    content = string.gsub(content,
+      math.tointeger(year - 2) .. "," .. math.tointeger(year - 1) .. "," .. year,
+      math.tointeger(year - 2) .. "-" .. year)
+  end
   if string.match(file, "%.1$") then
     return string.gsub(content,
       '%.TH l3build 1 "' .. iso .. '"\n',





More information about the latex3-commits mailing list.