diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07803faf8..80ed13fe7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,14 +26,14 @@ jobs: TestMatrix: strategy: matrix: - lua-version: ["5.4", "luajit"] + lua-version: ["5.4", "luajit-2.1"] os: ["ubuntu-latest", "macos-latest"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - - uses: leafo/gh-actions-lua@master + - uses: hishamhm/gh-actions-lua@master with: luaVersion: ${{ matrix.lua-version }} @@ -72,13 +72,12 @@ jobs: steps: - uses: actions/checkout@master - - uses: leafo/gh-actions-lua@v8.0.0 + - uses: hishamhm/gh-actions-lua@master with: luaVersion: "5.4" - name: Smoke Test run: | ./configure - ./makedist dev + ./makedist dev $(dirname $(dirname $(which lua))) ./smoke_test.sh luarocks-dev.tar.gz - diff --git a/GNUmakefile b/GNUmakefile index afb79cdf9..6fc94da8c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -134,7 +134,7 @@ uninstall: # ---------------------------------------- install-binary: binary install-config - mkdir -p "$(buildbinarydir)" + mkdir -p '$(DESTDIR)$(bindir)/' $(INSTALL) "$(buildbinarydir)/luarocks.exe" "$(DESTDIR)$(bindir)/luarocks" $(INSTALL) "$(buildbinarydir)/luarocks-admin.exe" "$(DESTDIR)$(bindir)/luarocks-admin" mkdir -p '$(DESTDIR)$(luadir)/luarocks/core' diff --git a/makedist b/makedist index 0cc247d3f..77899d51c 100755 --- a/makedist +++ b/makedist @@ -2,7 +2,7 @@ if ! [ "$1" ] then - echo "usage: $0 " + echo "usage: $0 " exit 1 fi @@ -17,6 +17,15 @@ make clean || exit 1 version=$1 shift +lua54dir=$1 +shift + +if ! [ -d "$lua54dir" ] +then + echo "Second argument must be the Lua 5.4 prefix." + exit 1 +fi + #------------------------------------------------------------------------------- if ! [ "$version" = "dev" ] then @@ -150,7 +159,7 @@ if [ "$1" = "binary" ] then shift - ./configure --lua-version=5.4 + ./configure --lua-version=5.4 --with-lua=$lua54dir make binary cd build-binary diff --git a/publishrelease b/publishrelease index 371450920..f11218ece 100755 --- a/publishrelease +++ b/publishrelease @@ -5,7 +5,7 @@ echo "example...: $0 3.1.1" echo echo "Before running this, make sure the packages were built:" - echo " makedist 3.1.1 binary sign" + echo " makedist 3.1.1 /opt/lua54/ binary sign" echo "And the tag was merged:" echo " mergerelease 3.1.1" echo @@ -55,7 +55,7 @@ function confirm() { echo "****************************************" git status echo "****************************************" - + echo "Everything looks all right? (y/n)" echo "(Answering y will commit and push)" read diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 998d18406..2d431cbea 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua @@ -382,11 +382,7 @@ local function get_config_text(cfg) -- luacheck: ignore 431 buf = buf.."\n Configuration files:\n" local conf = cfg.config_files - if not cfg.variables.FORCE_HARDCODED then - buf = buf.." System : "..show_status(fs.absolute_name(conf.system.file), conf.system.found).."\n" - else - buf = buf.." System : disabled in this LuaRocks installation.\n" - end + buf = buf.." System : "..show_status(fs.absolute_name(conf.system.file), conf.system.found).."\n" if conf.user.file then buf = buf.." User : "..show_status(fs.absolute_name(conf.user.file), conf.user.found).."\n" else diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 17160dfac..476482ea7 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -570,20 +570,6 @@ local function use_defaults(cfg, defaults) end end -local function get_first_arg() - local arg = rawget(_G, 'arg') - if not arg then - return - end - local first_arg = arg[0] - local i = -1 - while arg[i] do - first_arg = arg[i] - i = i -1 - end - return first_arg -end - -------------------------------------------------------------------------------- local cfg = {} @@ -741,14 +727,10 @@ function cfg.init(detected, warning) exit_ok, exit_err, exit_what = nil, err, "config" end - if hardcoded.FORCE_HARDCODED then - util.deep_merge(cfg.variables, hardcoded) - end - -- Load user configuration file (if allowed) local home_config_ok local project_config_ok - if not hardcoded.FORCE_CONFIG and not hardcoded.FORCE_HARDCODED then + if not hardcoded.FORCE_CONFIG then local env_var = "LUAROCKS_CONFIG_" .. cfg.lua_version:gsub("%.", "_") local env_value = os.getenv(env_var) if not env_value then @@ -800,6 +782,10 @@ function cfg.init(detected, warning) end end + if hardcoded.FORCE_HARDCODED then + util.deep_merge(cfg.variables, hardcoded) + end + -- backwards compatibility: if cfg.lua_interpreter and cfg.variables.LUA_BINDIR and not cfg.variables.LUA then cfg.variables.LUA = dir.path(cfg.variables.LUA_BINDIR, cfg.lua_interpreter)