[latex3-commits] [l3svn] 03/03: l3build: Reformate date only when used

noreply at latex-project.org noreply at latex-project.org
Fri Oct 9 10:04:45 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 8410a0f0b64576cc6ef11f565e2589e57ceaa1ba
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Oct 9 09:04:16 2015 +0100

    l3build: Reformate date only when used
---
 l3build/l3build.dtx |    3 ++-
 l3build/l3build.lua |   13 +++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/l3build/l3build.dtx b/l3build/l3build.dtx
index 74160bb..a585e61 100644
--- a/l3build/l3build.dtx
+++ b/l3build/l3build.dtx
@@ -974,7 +974,8 @@
 %           line,
 %           "^\\Provides" .. i .. "{[a-zA-Z0-9%-]+}%[[^%]]*%]$"
 %         ) then
-%           line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "[" .. date)
+%           line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "["
+%             .. string.gsub(date, "%-", "/")
 %           line = string.gsub(
 %             line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. version
 %           )
diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index 7ea6b9b..8aaf4dd 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -1671,7 +1671,6 @@ end
 if versionform ~= "" and not setversion_update_line then
   if versionform == "ProvidesPackage" then
     function setversion_update_line(line, date, version)
-      local date = string.gsub(date, "%-", "/")
       local i
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
@@ -1679,7 +1678,8 @@ if versionform ~= "" and not setversion_update_line then
           line,
           "^\\Provides" .. i .. "{[a-zA-Z0-9%-]+}%[[^%]]*%]$"
         ) then
-          line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "[" .. date)
+          line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "["
+            .. string.gsub(date, "%-", "/"))
           line = string.gsub(
             line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. version
           )
@@ -1690,7 +1690,6 @@ if versionform ~= "" and not setversion_update_line then
     end
   elseif versionform == "ProvidesExplPackage" then
     function setversion_update_line(line, date, version)
-      local date = string.gsub(date, "%-", "/")
       local i
       -- No real regex so do it one type at a time
       for _,i in pairs({"Class", "File", "Package"}) do
@@ -1701,7 +1700,7 @@ if versionform ~= "" and not setversion_update_line then
           line = string.gsub(
             line,
             "{%d%d%d%d/%d%d/%d%d}( *){[^}]*}",
-            "{" .. date .. "}%1{" .. version .. "}"
+            "{" .. string.gsub(date, "%-", "/") .. "}%1{" .. version .. "}"
           )
           break
         end
@@ -1710,9 +1709,8 @@ if versionform ~= "" and not setversion_update_line then
     end
   elseif versionform == "filename" then
     function setversion_update_line(line, date, version)
-      local date = string.gsub(date, "%-", "/")
       if string.match(line, "^\\def\\filedate{%d%d%d%d/%d%d/%d%d}$") then
-        line = "\\def\\filedate{" .. date .. "}"
+        line = "\\def\\filedate{" .. string.gsub(date, "%-", "/") .. "}"
       end
       if string.match(line, "^\\def\\fileversion{[^}]+}$") then
         line = "\\def\\fileversion{" .. version .. "}"
@@ -1721,9 +1719,8 @@ if versionform ~= "" and not setversion_update_line then
     end
   elseif versionform == "ExplFileName" then
     function setversion_update_line(line, date, version)
-      local date = string.gsub(date, "%-", "/")
       if string.match(line, "^\\def\\ExplFileDate{%d%d%d%d/%d%d/%d%d}$") then
-        line = "\\def\\ExplFileDate{" .. date .. "}"
+        line = "\\def\\ExplFileDate{" .. string.gsub(date, "%-", "/") .. "}"
       end
       if string.match(line, "^\\def\\ExplFileVersion{[^}]+}$") then
         line = "\\def\\ExplFileVersion{" .. version .. "}"

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


More information about the latex3-commits mailing list