[latex3-commits] [l3svn] branch master updated: Allow for l3build.lua itself in version setting

noreply at latex-project.org noreply at latex-project.org
Thu Oct 8 14:56:44 CEST 2015


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  aa91951   Allow for l3build.lua itself in version setting
aa91951 is described below

commit aa9195176a8db81daaa21b1a23323ee9da3938a9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Oct 8 13:56:28 2015 +0100

    Allow for l3build.lua itself in version setting
---
 l3build/build.lua |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/l3build/build.lua b/l3build/build.lua
index 0cbcfc9..b0b8de4 100644
--- a/l3build/build.lua
+++ b/l3build/build.lua
@@ -15,6 +15,33 @@ cleanfiles   = {"*.pdf", "*.tex", "*.zip"}
 installfiles = {"l3build.lua", "regression-test.tex"}
 sourcefiles  = {"*.dtx", "l3build.lua", "*.ins"}
 unpackdeps   = { }
+versionfiles = {"*.dtx", "*.md", "l3build.lua"}
+
+-- Detail how to set the version automatically
+function setversion_update_line(line, date, version)
+  local date = string.gsub(date, "%-", "/")
+  -- Replace the identifiers in .dtx files
+  if string.match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
+    line = "\\def\\ExplFileDate{" .. date .. "}"
+  end
+  if string.match(line, "^\\def\\ExplFileVersion{%d+}$") then
+    line = "\\def\\ExplFileVersion{" .. version .. "}"
+  end
+  -- Markdown files
+  if string.match(
+    line, "^Release %d%d%d%d/%d%d/%d%d %(r%d%d%d%d%)$"
+  ) then
+    line = "Release " .. date .. " (r" .. version .. ")"
+  end
+  -- l3build.lua
+  if string.match(line, "^release_date = \"%d%d%d%d/%d%d/%d%d\"$") then
+    line = "release_date = \"" .. date .. "\""
+  end
+  if string.match(line, "^release_ver  = \"%d%d%d%d\"$") then
+    line = "release_ver  = \"" .. version .. "\""
+  end
+  return line
+end
 
 -- Load the common build code: this is the one place that a path needs to be
 -- hard-coded

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list