Skip to content

Commit

Permalink
make file updates for buildVersion_src
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Feb 28, 2024
1 parent ab0ca8b commit dc1afc4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
12 changes: 7 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ 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;$$LUA_PATH;;" $(srcdir)/proj_mgmt/buildVersion_src
BUILD_V_src := LUA_PATH="$(srcdir)/tools/?.lua;$$LUA_PATH;;" $(srcdir)/proj_mgmt/buildVersion_src
PS := @PS@
READLINK := @READLINK@
EXPR := @EXPR@
Expand Down Expand Up @@ -545,12 +545,14 @@ libexec: $(lua_code)
$(MAKE) FILELIST="$^" DIRLOC=$(DESTDIR)$(LIBEXEC) GIT_VERSION=$(GIT_VERSION) __installMe

VersionSrc:
$(BUILDV_src) -b $(GIT_BRANCH) -t $(TAG) -g $(GIT_VERSION) \
-d $(VDATE) > $(DESTDIR)$(LIBEXEC)/Version.lua
echo LUA_PATH: $$LUA_PATH
echo LUA_CPATH: $$LUA_CPATH
$(BUILD_V_src) -b $(GIT_BRANCH) -t $(version) -g $(GIT_VERSION) \
-d $(VDATE) > $(DESTDIR)$(LIBEXEC)/Version.lua

STVersionSrc:
$(BUILDV_src) -b $(GIT_BRANCH) -t $(TAG) -g $(GIT_VERSION) \
-d $(VDATE) > $(DESTDIR)$(SETTARG)/Version.luaSTVersionSrc
$(BUILD_V_src) -b $(GIT_BRANCH) -t $(version) -g $(GIT_VERSION) \
-d $(VDATE) > $(DESTDIR)$(SETTARG)/Version.luaSTVersionSrc



Expand Down
4 changes: 2 additions & 2 deletions build.rtm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ parallel_make_install()
fi

if [ "$BUILD_TYPE" != "EXPERIMENTAL" ]; then
echo "$SUDO $MAKE GIT_VERSION=$GIT_VERSION -j install $MAKE_EXTRA"
$SUDO $MAKE GIT_VERSION=$GIT_VERSION -j install $MAKE_EXTRA
echo "$SUDO $MAKE GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA"
$SUDO $MAKE 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
Expand Down
32 changes: 24 additions & 8 deletions proj_mgmt/buildVersion_src
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
-- -*- lua -*-

Version = "0.0"
_G._DEBUG = false
local posix = require("posix")

require("strict")
require("string_utils")
require("VarDump")
local Optiks = require("Optiks")
local dbg = require("Dbg"):dbg()
local s_mTbl = {}
Expand Down Expand Up @@ -45,41 +44,58 @@ function buildVersionCode(branch, tag, gittag, dateStr)
end


-- This function forces the option parser to write to stderr instead of
-- stdout.
local function l_prt(...)
stderr:write(...)
end


--------------------------------------------------------------------------
-- This function prevents the option parser from exiting when it finds an
-- error.
local function l_nothing()
end

function main()
options()
local mTbl = mTbl()
print("branch: ",mTbl.branch)
local s = buildVersionCode(mTbl.branch, mTbl.tag, mTbl.gittag, mTbl.vdate)
print (s)
end

function options()
local mTbl = mTbl()
local usage = "Usage: buildVersion.lua --branch branch --tag tag --gittag gittag --vdate dateStr outfile"
local cmdlineParser = Optiks:new{usage=usage, version=Version}
local cmdlineParser = Optiks:new{usage=usage,
error=l_nothing,
exit=l_nothing,
prt=l_prt,
version=Version}

cmdlineParser:add_option{
name = {'-v','--verbose'},
dest = 'verbosityLevel',
action = 'count',
}
cmdlineParser:add_option{
name = {'--branch'},
name = {'-b','--branch'},
dest = 'branch',
action = 'store',
}
cmdlineParser:add_option{
name = {'--tag'},
name = {'-t','--tag'},
dest = 'tag',
action = 'store',
}
cmdlineParser:add_option{
name = {'--gittag'},
name = {'-g','--gittag'},
dest = 'gittag',
action = 'store',
}
cmdlineParser:add_option{
name = {'--vdate'},
name = {'-d','--vdate'},
dest = 'vdate',
action = 'store',
}
Expand Down

0 comments on commit dc1afc4

Please sign in to comment.