diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/build/command.lua | 20 | ||||
| -rw-r--r-- | src/luarocks/build/command.tl | 20 |
2 files changed, 2 insertions, 38 deletions
diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.lua index 22bed11b..a4eddb87 100644 --- a/src/luarocks/build/command.lua +++ b/src/luarocks/build/command.lua | |||
| @@ -25,22 +25,8 @@ function command.run(rockspec, not_install) | |||
| 25 | 25 | ||
| 26 | local build = rockspec.build | 26 | local build = rockspec.build |
| 27 | 27 | ||
| 28 | -- Save the original install command before substitution, | ||
| 29 | -- so we can display it with the final deploy paths instead of the staging paths. | ||
| 30 | local orig_install_command = build.install_command | ||
| 31 | |||
| 32 | util.variable_substitutions(build, rockspec.variables) | 28 | util.variable_substitutions(build, rockspec.variables) |
| 33 | 29 | ||
| 34 | -- Create display variables that replace LUADIR/LIBDIR/BINDIR with the | ||
| 35 | -- actual deploy directories so the printed command shows the final destination. | ||
| 36 | local display_vars = {} | ||
| 37 | for k, v in pairs(rockspec.variables) do | ||
| 38 | display_vars[k] = v | ||
| 39 | end | ||
| 40 | if cfg.deploy_lua_dir then display_vars.LUADIR = cfg.deploy_lua_dir end | ||
| 41 | if cfg.deploy_lib_dir then display_vars.LIBDIR = cfg.deploy_lib_dir end | ||
| 42 | if cfg.deploy_bin_dir then display_vars.BINDIR = cfg.deploy_bin_dir end | ||
| 43 | |||
| 44 | local env = { | 30 | local env = { |
| 45 | CC = cfg.variables.CC, | 31 | CC = cfg.variables.CC, |
| 46 | 32 | ||
| @@ -54,11 +40,7 @@ function command.run(rockspec, not_install) | |||
| 54 | end | 40 | end |
| 55 | end | 41 | end |
| 56 | if build.install_command and not not_install then | 42 | if build.install_command and not not_install then |
| 57 | -- Print with deploy paths for user clarity | 43 | util.printout(build.install_command) |
| 58 | local display = {install_command = orig_install_command} | ||
| 59 | util.variable_substitutions(display, display_vars) | ||
| 60 | util.printout(display.install_command) | ||
| 61 | -- Execute with staging paths (internal mechanism) | ||
| 62 | if not fs.execute_env(env, build.install_command) then | 44 | if not fs.execute_env(env, build.install_command) then |
| 63 | return nil, "Failed installing." | 45 | return nil, "Failed installing." |
| 64 | end | 46 | end |
diff --git a/src/luarocks/build/command.tl b/src/luarocks/build/command.tl index 18f17ad9..10f8bb94 100644 --- a/src/luarocks/build/command.tl +++ b/src/luarocks/build/command.tl | |||
| @@ -25,22 +25,8 @@ function command.run(rockspec: Rockspec, not_install: boolean): boolean, string, | |||
| 25 | 25 | ||
| 26 | local build = rockspec.build as command.CommandBuild | 26 | local build = rockspec.build as command.CommandBuild |
| 27 | 27 | ||
| 28 | -- Save the original install command before substitution, | ||
| 29 | -- so we can display it with the final deploy paths instead of the staging paths. | ||
| 30 | local orig_install_command = build.install_command | ||
| 31 | |||
| 32 | util.variable_substitutions(build as {string: string}, rockspec.variables) | 28 | util.variable_substitutions(build as {string: string}, rockspec.variables) |
| 33 | 29 | ||
| 34 | -- Create display variables that replace LUADIR/LIBDIR/BINDIR with the | ||
| 35 | -- actual deploy directories so the printed command shows the final destination. | ||
| 36 | local display_vars: {string: string} = {} | ||
| 37 | for k, v in pairs(rockspec.variables as {string: string}) do | ||
| 38 | display_vars[k] = v | ||
| 39 | end | ||
| 40 | if cfg.deploy_lua_dir then display_vars.LUADIR = cfg.deploy_lua_dir end | ||
| 41 | if cfg.deploy_lib_dir then display_vars.LIBDIR = cfg.deploy_lib_dir end | ||
| 42 | if cfg.deploy_bin_dir then display_vars.BINDIR = cfg.deploy_bin_dir end | ||
| 43 | |||
| 44 | local env: {string: string} = { | 30 | local env: {string: string} = { |
| 45 | CC = cfg.variables.CC, | 31 | CC = cfg.variables.CC, |
| 46 | --LD = cfg.variables.LD, | 32 | --LD = cfg.variables.LD, |
| @@ -54,11 +40,7 @@ function command.run(rockspec: Rockspec, not_install: boolean): boolean, string, | |||
| 54 | end | 40 | end |
| 55 | end | 41 | end |
| 56 | if build.install_command and not not_install then | 42 | if build.install_command and not not_install then |
| 57 | -- Print with deploy paths for user clarity | 43 | util.printout(build.install_command) |
| 58 | local display: {string: string} = {install_command = orig_install_command} | ||
| 59 | util.variable_substitutions(display, display_vars) | ||
| 60 | util.printout(display.install_command) | ||
| 61 | -- Execute with staging paths (internal mechanism) | ||
| 62 | if not fs.execute_env(env, build.install_command) then | 44 | if not fs.execute_env(env, build.install_command) then |
| 63 | return nil, "Failed installing." | 45 | return nil, "Failed installing." |
| 64 | end | 46 | end |
