[latex3-commits] [l3svn] 02/02: l3build: Make the line update function more specific

noreply at latex-project.org noreply at latex-project.org
Thu Oct 8 10:25:31 CEST 2015


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

joseph pushed a commit to branch master
in repository l3svn.

commit 3369944c999d7689305ef6bf5a20ebc32d396540
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Oct 8 09:25:00 2015 +0100

    l3build: Make the line update function more specific
    
    The name really should point to exactly where this is used.
---
 build-config.lua    |    2 +-
 l3build/l3build.dtx |    6 +++---
 l3build/l3build.lua |   12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/build-config.lua b/build-config.lua
index 7e514ea..511fa3b 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -22,7 +22,7 @@ if unpacksearch == nil then
 end
 
 -- Detail how to set the version automatically
-function update_line(line, date, version)
+function setversion_update_line(line, date, version)
   local date = string.gsub(date, "%-", "/")
   -- Replace the identifiers
   if string.match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
diff --git a/l3build/l3build.dtx b/l3build/l3build.dtx
index 3624110..6aa4608 100644
--- a/l3build/l3build.dtx
+++ b/l3build/l3build.dtx
@@ -959,13 +959,13 @@
 % Lua function |update.line()|, which takes as arguments the line of the
 % source, the supplied date and the supplied version. It should return a
 % (possibly unmodified) line and may use one, both or neither of the
-% date and version to update the line. Typically, |update_line| should
+% date and version to update the line. Typically, |setversion_update_line| should
 % match to the exact pattern used by the programmer in the source files.
 % For example, for code using macros for the date and version
 % a suitable function might read as shown in Figure~\ref{fig:update-line}.
 % \begin{figure}
 %   \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6]
-%     function update_line(line, date, version)
+%     function setversion_update_line(line, date, version)
 %       local i
 %       -- No real regex so do it one type at a time
 %       for _,i in pairs({"Class", "File", "Package"}) do
@@ -983,7 +983,7 @@
 %       return line
 %     end
 %   \end{lstlisting}
-%   \caption{Example \texttt{update_line} function.}
+%   \caption{Example \texttt{setversion_update_line} function.}
 %   \label{fig:update-line}
 % \end{figure}
 %
diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index d301e56..6f4f8d6 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -1669,7 +1669,7 @@ end
 -- Provide some standard search-and-replace functions
 if versionform ~= "" and not updateline then
   if versionform == "ProvidesPackage" then
-    function update_line(line, date, version)
+    function setversion_update_line(line, date, version)
       local i
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
@@ -1687,7 +1687,7 @@ if versionform ~= "" and not updateline then
       return line
     end
   elseif versionform == "ProvidesExplPackage" then
-    function update_line(line, date, version)
+    function setversion_update_line(line, date, version)
       local i
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
@@ -1705,7 +1705,7 @@ if versionform ~= "" and not updateline then
       return line
     end
   elseif versionform == "filename" then
-    function update_line(line, date, version)
+    function setversion_update_line(line, date, version)
       if string.match(line, "^\\def\\filedate{%d%d%d%d/%d%d/%d%d}$") then
         line = "\\def\\filedate{" .. date .. "}"
       end
@@ -1715,7 +1715,7 @@ if versionform ~= "" and not updateline then
       return line
     end
   elseif versionform == "ExplFileName" then
-    function update_line(line, date, version)
+    function setversion_update_line(line, date, version)
       if string.match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
         line = "\\def\\ExplFileDate{" .. date .. "}"
       end
@@ -1728,7 +1728,7 @@ if versionform ~= "" and not updateline then
 end
 
 -- Used to actually carry out search-and-replace
-update_line = update_line or function(line, date, version)
+setversion_update_line = setversion_update_line or function(line, date, version)
   return line
 end
 
@@ -1737,7 +1737,7 @@ function setversion()
     local changed = false
     local lines = ""
     for line in io.lines(file) do
-      local newline = update_line(line, date, version)
+      local newline = setversion_update_line(line, date, version)
       if newline ~= line then
         line = newline
         changed = true

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


More information about the latex3-commits mailing list