Skip to content

Commit

Permalink
Check tarantool dependence working under tt
Browse files Browse the repository at this point in the history
When luarocks is running from under tt we need to
use another tarantool dependency check method because
luarocks are not running inside tarantool and has no
access to _TARANTOOL variable.

Part of the tarantool/tt#114
  • Loading branch information
0x501D committed Sep 15, 2023
1 parent ebf0a6d commit 69dbb85
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/luarocks/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,16 @@ function util.get_rocks_provided(rockspec)
rocks_provided["tarantool"] = tarantool_version.."-1"
end

-- If luarocks is launched from tt, it cannot directly access
-- the _TARANTOOL variable.
local tarantool_ver_env = os.getenv("TT_CLI_TARANTOOL_VERSION")
if tarantool_ver_env ~= nil then
local tarantool_version = tarantool_ver_env:match("([^-]+)-")
if tarantool_version ~= nil then
rocks_provided["tarantool"] = tarantool_version.."-1"
end
end

if cfg.rocks_provided then
util.deep_merge_under(rocks_provided, cfg.rocks_provided)
end
Expand Down

0 comments on commit 69dbb85

Please sign in to comment.