[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Allow for building deployment on Travis-CI (82cf0ea2)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Feb 3 11:38:19 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/82cf0ea2cb30f85aa2142ce8787533852da876c8

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

commit 82cf0ea2cb30f85aa2142ce8787533852da876c8
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Feb 3 10:37:13 2020 +0000

    Allow for building deployment on Travis-CI


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

82cf0ea2cb30f85aa2142ce8787533852da876c8
 build-config.lua | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/build-config.lua b/build-config.lua
index 963a4b99..4fe8f8a2 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -67,24 +67,31 @@ end
 --
 -- This must be global as it is needed by the base file to set up MakeIndex
 master_branch = true
+-- To test for the branch, we need to allow for both Travis-CI and
+-- local set ups; on Travis-CI, tags are not on a branch as far as Git
+-- is concerned
+local branch = os.getenv("TRAVIS_BRANCH")
+-- Local set ups can use Git
 -- See stackoverflow.com/a/12142066/212001
-local errorlevel = os.execute("git rev-parse --abbrev-ref HEAD > branch.tmp")
-if errorlevel ~= 0 then
-  exit(1)
-else
-  local f = assert(io.open("branch.tmp", "rb"))
-  local branch = f:read("*all")
-  f:close()
-  os.remove("branch.tmp")
-  if not string.match(branch, "%s*master%s*") and
-     not string.match(branch, "^release/") then
-    master_branch = false
-    tdsroot = tdsroot or "latex-dev"
-    ctanpkg = ctanpkg or ""
-    ctanpkg = ctanpkg .. "-dev"
-    ctanzip = ctanpkg
+if not branch then
+  local errorlevel = os.execute("git rev-parse --abbrev-ref HEAD > branch.tmp")
+  if errorlevel ~= 0 then
+    exit(1)
+  else
+    local f = assert(io.open("branch.tmp", "rb"))
+    branch = f:read("*all")
+    f:close()
+    os.remove("branch.tmp")
   end
 end
+if not string.match(branch, "%s*master%s*") and
+   not string.match(branch, "^release/") then
+  master_branch = false
+  tdsroot = tdsroot or "latex-dev"
+  ctanpkg = ctanpkg or ""
+  ctanpkg = ctanpkg .. "-dev"
+  ctanzip = ctanpkg
+end
 
 -- Detail how to set the version automatically
 --  Used by base, cyrillic, tools





More information about the latex3-commits mailing list.