[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Enable auto-tagging of ltvers (6baa73b4)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Jul 23 16:01:51 CEST 2019


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/6baa73b4cbced7e03e63cf9c56f996110fc0142e

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

commit 6baa73b4cbced7e03e63cf9c56f996110fc0142e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Jul 23 15:01:51 2019 +0100

    Enable auto-tagging of ltvers


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

6baa73b4cbced7e03e63cf9c56f996110fc0142e
 base/build.lua   | 30 ++++++++++++++++++++++++++++++
 build-config.lua |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/base/build.lua b/base/build.lua
index 251edbed..94b9e427 100644
--- a/base/build.lua
+++ b/base/build.lua
@@ -113,6 +113,36 @@ indexstyle = "source2e.ist"
 -- Allow for TU test
 checkconfigs = {"build","config-TU"}
 
+-- Detail how to set the version automatically
+tagfiles = {"README.md", "ltvers.dtx"}
+function update_tag(file,content,tagname,tagdate)
+  local iso = "%d%d%d%d%-%d%d%-%d%d"
+  local tag, rev = string.match(tagname,"^(.*):([^:]*)$")
+  local patch_level = ""
+  if master_branch then
+    if rev then
+      tag = tag .. " patch level " .. rev
+      patch_level = rev
+    end
+  else
+    tag = tag .. " pre-release "
+    if rev then
+      tag = tag .. rev
+      patch_level = "-" .. rev
+    end
+  end
+  if file == "README.md" then
+    return string.gsub(content,
+      "\nRelease " .. iso .. "[^\n]*\n",
+      "\nRelease " .. tag .. "\n")
+  elseif file == "ltvers.dtx" then
+    return string.gsub(content,
+      "\\patch at level{%-?%d+}",
+      "\\patch at level{" .. patch_level .. "}")
+  end
+  return content
+end
+
 function format ()
   local errorlevel = unpack ()
   if errorlevel ~=0 then
diff --git a/build-config.lua b/build-config.lua
index ff072d6b..b2f51f00 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -59,7 +59,7 @@ else
 end
 
 -- Detail how to set the version automatically
-function update_tag(file,content,tagname,tagdate)
+update_tag = update_tag or function (file,content,tagname,tagdate)
   local iso = "%d%d%d%d%-%d%d%-%d%d"
   local tag, rev = string.match(tagname,"^(.*):([^:]*)$")
   if master_branch then





More information about the latex3-commits mailing list