aboutsummaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorMike Pall <mike>2023-08-28 21:25:51 +0200
committerMike Pall <mike>2023-08-28 21:25:51 +0200
commit6a3111a57f817cb00ef2ab6f2553cd887ec36462 (patch)
treeecf248d80839e8bcce7357eba1654eddfa26b749 /src/host
parenta0b52aae33ffaeff2cc3f28b6e125f9582b133d6 (diff)
downloadluajit-6a3111a57f817cb00ef2ab6f2553cd887ec36462.tar.gz
luajit-6a3111a57f817cb00ef2ab6f2553cd887ec36462.tar.bz2
luajit-6a3111a57f817cb00ef2ab6f2553cd887ec36462.zip
Use fallback name for install files without valid .git or .relver.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/genversion.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/host/genversion.lua b/src/host/genversion.lua
index a38cec56..42b5e6fe 100644
--- a/src/host/genversion.lua
+++ b/src/host/genversion.lua
@@ -5,9 +5,9 @@
5-- Released under the MIT license. See Copyright Notice in luajit.h 5-- Released under the MIT license. See Copyright Notice in luajit.h
6---------------------------------------------------------------------------- 6----------------------------------------------------------------------------
7 7
8local FILE_INPUT_H = "luajit_rolling.h" 8local FILE_ROLLING_H = "luajit_rolling.h"
9local FILE_INPUT_R = "luajit_relver.txt" 9local FILE_RELVER_TXT = "luajit_relver.txt"
10local FILE_OUTPUT_H = "luajit.h" 10local FILE_LUAJIT_H = "luajit.h"
11 11
12local function file_read(file) 12local function file_read(file)
13 local fp = assert(io.open(file, "rb"), "run from the wrong directory") 13 local fp = assert(io.open(file, "rb"), "run from the wrong directory")
@@ -28,8 +28,8 @@ local function file_write_mod(file, data)
28 assert(fp:close()) 28 assert(fp:close())
29end 29end
30 30
31local text = file_read(FILE_INPUT_H) 31local text = file_read(FILE_ROLLING_H)
32local relver = file_read(FILE_INPUT_R):match("(%d+)") 32local relver = file_read(FILE_RELVER_TXT):match("(%d+)")
33 33
34if relver then 34if relver then
35 text = text:gsub("ROLLING", relver) 35 text = text:gsub("ROLLING", relver)
@@ -38,6 +38,7 @@ else
38**** WARNING Cannot determine rolling release version from git log. 38**** WARNING Cannot determine rolling release version from git log.
39**** WARNING The 'git' command must be available during the build. 39**** WARNING The 'git' command must be available during the build.
40]]) 40]])
41 file_write_mod(FILE_RELVER_TXT, "ROLLING\n") -- Fallback for install target.
41end 42end
42 43
43file_write_mod(FILE_OUTPUT_H, text) 44file_write_mod(FILE_LUAJIT_H, text)