Skip to content

Commit

Permalink
Merge branch 'PR684' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Mar 12, 2024
2 parents 54bd362 + 265f169 commit 2dbe9c2
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 23 deletions.
10 changes: 5 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
srcdir := @srcdir@
prefix := @prefix@
SYS_LUA_PATH := @SYS_LUA_PATH@
SYS_LUA_CPATH := @SYS_LUA_CPATH@
package := lmod
ifeq ($(PATH_TO_SRC),@$(path_to_src)@)
PATH_TO_SRC := .
endif
PATH_TO_LUA := @PATH_TO_LUA@
version := $(shell LUA_PATH="$(srcdir)/src/?.lua;" $(PATH_TO_LUA) -e "V=require('Version'); print(V.tag())")
version := $(shell LUA_PATH="$(srcdir)/src/?.lua;$(SYS_LUA_PATH)" $(PATH_TO_LUA) -e "V=require('Version'); print(V.tag())")
SITE_CONTROLLED_PREFIX := @SITE_CONTROLLED_PREFIX@
LMOD_ROOT := $(prefix)/$(package)
MY_PACKAGE := $(prefix)/$(package)/$(version)
Expand Down Expand Up @@ -49,8 +51,6 @@ DYNAMIC_SPIDER_CACHE := @DYNAMIC_SPIDER_CACHE@
SILENCE_SHELL_DEBUGGING := @SILENCE_SHELL_DEBUGGING@
SYS_LD_LIB_PATH := @SYS_LD_LIB_PATH@
SYS_LD_PRELOAD := @SYS_LD_PRELOAD@
SYS_LUA_PATH := @SYS_LUA_PATH@
SYS_LUA_CPATH := @SYS_LUA_CPATH@
CASE_INDEPENDENT_SORTING := @CASE_INDEPENDENT_SORTING@
ORIG_ZSH_VERSION := @ORIG_ZSH_VERSION@
ZSH_SITE_FUNCTIONS_DIRS := @ZSH_SITE_FUNCTIONS_DIRS@
Expand All @@ -73,8 +73,8 @@ SPIDER_CACHE_DIRS := @SPIDER_CACHE_DIRS@
LEGACY_ORDERING := @LEGACY_ORDERING@
EXPORT_MODULE := @EXPORT_MODULE@
BASENAME := @BASENAME@
UPDATE_VERSION := LUA_PATH="$(srcdir)/tools/?.lua;$$LUA_PATH;;" $(srcdir)/proj_mgmt/updateVersion
BUILD_V_src := LUA_PATH="$(srcdir)/tools/?.lua;$(SYS_LUA_PATH)" LUA_CPATH="$(SYS_LUA_CPATH)" $(srcdir)/proj_mgmt/buildVersion_src
UPDATE_VERSION := LUA_PATH="$(srcdir)/tools/?.lua;$(SYS_LUA_PATH)" $(PATH_TO_LUA) $(srcdir)/proj_mgmt/updateVersion
BUILD_V_src := LUA_PATH="$(srcdir)/tools/?.lua;$(SYS_LUA_PATH)" LUA_CPATH="$(SYS_LUA_CPATH)" $(PATH_TO_LUA) $(srcdir)/proj_mgmt/buildVersion_src
PS := @PS@
READLINK := @READLINK@
EXPR := @EXPR@
Expand Down
1 change: 1 addition & 0 deletions build.rtm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parallel_make_install()
$SUDO $MAKE -j GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA
else
echo "$SUDO $MAKE pre-install $MAKE_EXTRA"
#$SUDO $MAKE GIT_VERSION=$GIT_VERSION -j pre-install $MAKE_EXTRA
$SUDO $MAKE GIT_VERSION=$GIT_VERSION -j pre-install $MAKE_EXTRA
$SUDO rm -f $BASE_DIR/lmod/EXPERIMENTAL
$SUDO ln -s $PKG_VERSION $BASE_DIR/lmod/EXPERIMENTAL
Expand Down
34 changes: 18 additions & 16 deletions proj_mgmt/buildVersion_src
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env lua
-- -*- lua -*-

Version = "0.0"
Expand All @@ -12,29 +11,32 @@ function buildVersionCode(branch, tag, gittag, dateStr)
local a = {}
a[#a+1] = 'local M={}'
a[#a+1] = 'function M.branch()'
a[#a+1] = ' local s = "'.. branch ..'"'
a[#a+1] = ' return "'.. branch ..'"'
a[#a+1] = 'end'
a[#a+1] = 'function M.branchStr()'
a[#a+1] = ' local s = M.branch()'
a[#a+1] = ' if (s == "main") then'
a[#a+1] = ' s = ""'
a[#a+1] = ' end'
a[#a+1] = ' return s == "" and s or "[branch: "..s.."]"'
a[#a+1] = 'end'
a[#a+1] = 'function M.tag() return "'..tag..'" end'
a[#a+1] = 'function M.git()'
a[#a+1] = ' local s = "'..gittag..'"'
a[#a+1] = 'function M.git()'
a[#a+1] = ' local s = "'..gittag..'"'
a[#a+1] = ' if (s == "@" .. "git@") then s = "" end'
a[#a+1] = ' if (s == M.tag() ) then s = "" end'
a[#a+1] = ' return s == "" and s or "("..s..")"'
a[#a+1] = 'end'
a[#a+1] = 'function M.date() return "'..dateStr..'" end'
a[#a+1] = 'function M.name()'
a[#a+1] = ' local a = {}'
a[#a+1] = ' a[#a+1] = M.tag()'
a[#a+1] = ' a[#a+1] = M.git()'
a[#a+1] = ' a[#a+1] = M.branch()'
a[#a+1] = ' a[#a+1] = M.date()'
a[#a+1] = ' return table.concat(a," ")'
a[#a+1] = 'end'
a[#a+1] = 'return M'
a[#a+1] = ' return s == "" and s or "("..s..")"'
a[#a+1] = 'end'
a[#a+1] = 'function M.date() return "'..dateStr..'" end'
a[#a+1] = 'function M.name()'
a[#a+1] = ' local a = {}'
a[#a+1] = ' a[#a+1] = M.tag()'
a[#a+1] = ' a[#a+1] = M.git()'
a[#a+1] = ' a[#a+1] = M.branchStr()'
a[#a+1] = ' a[#a+1] = M.date()'
a[#a+1] = ' return table.concat(a," ")'
a[#a+1] = 'end'
a[#a+1] = 'return M'
return table.concat(a,"\n")
end

Expand Down
2 changes: 2 additions & 0 deletions rt/common_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ cleanUp ()
-e "s|^LMOD_LD_PRELOAD.*||g" \
-e "s|^LuaFileSystem version.*||g" \
-e "s|^Lua Version.*||g" \
-e "s|^Lmod branch.*||g" \
-e "s|^LMOD_BRANCH.*||g" \
-e "s|^\(uname -a\).*|\1|g" \
-e "s|^\(TARG_HOST=\).*|\1'some_host';|g" \
-e "s|^\(TARG_OS_FAMILY=\).*|\1'some_os_family';|g"\
Expand Down
2 changes: 2 additions & 0 deletions src/Configuration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ local function l_new(self)
local lmod_configDir = cosmic:value("LMOD_CONFIG_DIR")
local lmod_lang = cosmic:value("LMOD_LANG")
local lmodrc = cosmic:value("LMOD_RC")
local lmod_branch = cosmic:value("LMOD_BRANCH")
local lua_path = cosmic:value("PATH_TO_LUA")
local mpath_avail = cosmic:value("LMOD_MPATH_AVAIL")
local mpath_init = cosmic:value("LMOD_MODULEPATH_INIT")
Expand Down Expand Up @@ -231,6 +232,7 @@ local function l_new(self)
tbl.lfsV = { k = "LuaFileSystem version" , v = lfsV, n = false }
tbl.lmod_cfg = { k = "lmod_config.lua location" , v = lmod_cfg_path, n = "LMOD_CONFIG_LOCATION" }
tbl.lmodV = { k = "Lmod version" , v = lmod_version, n = false }
tbl.lmod_branch = { k = "Lmod branch" , v = lmod_branch, n = "LMOD_BRANCH" }
tbl.luaV = { k = "Lua Version" , v = _VERSION, n = false }
tbl.lua_term = { k = "System lua-term" , v = have_term, n = "LMOD_HAVE_LUA_TERM" }
tbl.lua_term_A = { k = "Active lua-term" , v = activeTerm, n = false }
Expand Down
16 changes: 14 additions & 2 deletions src/Version.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
local M={}
function M.branch()
return "main"
end
function M.branchStr()
local s = M.branch()
if (s == "main") then
s = ""
end
return s == "" and s or "[branch: "..s.."]"
end
function M.tag() return "<tag>" end
function M.tag() return "8.7.34" end
function M.git()
local s = "@git@"
local s = "8.7.34-25-g516266fa"
if (s == "@" .. "git@") then s = "" end
if (s == M.tag() ) then s = "" end
return s == "" and s or "("..s..")"
end
function M.date() return "2024-01-05 19:34 -07:00" end
function M.date() return "2024-03-11 18:05 -06:00" end
function M.name()
local a = {}
a[#a+1] = M.tag()
a[#a+1] = M.git()
a[#a+1] = M.branchStr()
a[#a+1] = M.date()
return table.concat(a," ")
end
Expand Down
9 changes: 9 additions & 0 deletions src/myGlobals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ require("strict")
require("declare")
require("fileOps")

local Version = require("Version")
local cosmic = require("Cosmic"):singleton()
local lfs = require("lfs")
local getenv = os.getenv
Expand All @@ -59,6 +60,14 @@ end

LuaV = (_VERSION:gsub("Lua ",""))

------------------------------------------------------------------------
-- Lmod branch
------------------------------------------------------------------------
cosmic:init{name = "LMOD_BRANCH",
default = "main",
assignV = Version.branch()}


------------------------------------------------------------------------
-- Lmod ExitHookArray Object:
------------------------------------------------------------------------
Expand Down

0 comments on commit 2dbe9c2

Please sign in to comment.