[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Enable auto-tagging of README files (68c57836)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Jul 10 23:50:33 CEST 2019


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/68c57836aee755dfc23c6670f7b79bdacdf6c7a6

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

commit 68c57836aee755dfc23c6670f7b79bdacdf6c7a6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Jul 10 22:50:14 2019 +0100

    Enable auto-tagging of README files
    
    Can extend later if we wish to ltvers.dtx or similar.
    Mumble


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

68c57836aee755dfc23c6670f7b79bdacdf6c7a6
 build-config.lua | 22 ++++++++++++++++++++++
 build.lua        |  2 ++
 doc/build.lua    |  1 +
 3 files changed, 25 insertions(+)

diff --git a/build-config.lua b/build-config.lua
index dca08d2a..f6ca13cd 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -14,6 +14,7 @@ checkruns      = checkruns          or  2
 checksuppfiles = checksuppfiles     or
   {"color.cfg", "graphics.cfg", "test209.tex", "test2e.tex", "xetex.def", "dvips.def", "lipsum.sty"}
 stdengine      = stdengine          or "etex"
+tagfiles       = tagfiles or {"README.md"}
 typesetsuppfiles = typesetsuppfiles or {"ltxdoc.cfg", "ltxguide.cfg"}
 
 -- Build TDS-style zips
@@ -30,6 +31,7 @@ end
 -- Allow for 'dev' release
 -- See stackoverflow.com/a/12142066/212001
 local errorlevel = os.execute("git rev-parse --abbrev-ref HEAD > branch.tmp")
+local master_branch = true
 if errorlevel ~= 0 then
   exit(1)
 else
@@ -38,6 +40,26 @@ else
   f:close()
   os.remove("branch.tmp")
   if not string.match(branch, "%s*master%s*") then
+    master_branch = false
     tdsroot = tdsroot or "latex-dev"
   end
 end
+
+-- Detail how to set the version automatically
+function update_tag(file,content,tagname,tagdate)
+  local iso = "%d%d%d%d%-%d%d%-%d%d"
+  local tag, rev = string.match(tagname,"^(.*):([^:]*)$")
+  if master_branch then
+    if rev then
+      tag = tag .. " patch level " .. rev
+    end
+  else
+    tag = tag .. " pre-release "
+    if rev then
+      tag = tag .. rev
+    end
+  end
+  return string.gsub(content,
+    "\nRelease " .. iso .. "[^\n]*\n",
+    "\nRelease " .. tag .. "\n")
+end
\ No newline at end of file
diff --git a/build.lua b/build.lua
index 97f1b149..360ffedf 100644
--- a/build.lua
+++ b/build.lua
@@ -59,6 +59,8 @@ function main (target)
     errorlevel = dobundles ("doc")
   elseif target == "install" then
     errorlevel = dobundles ("install")
+  elseif target == "tag" then
+    errorlevel = dobundles("tag")
   elseif target == "uninstall" then
     errorlevel = dobundles("uninstall")
   elseif target == "unpack" then
diff --git a/doc/build.lua b/doc/build.lua
index 91631749..6883394b 100644
--- a/doc/build.lua
+++ b/doc/build.lua
@@ -15,6 +15,7 @@ maindir = ".."
 -- Set up the file types needed here
 installfiles = { }
 sourcefiles  = {"ltnews??.tex"}
+tagfiles = {"README-doc.md"}
 typesetfiles =
   {
     "cfgguide.tex",





More information about the latex3-commits mailing list