From eddf776d64941454377f996733f96873cb79bcae Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 11 Apr 2022 16:15:15 -0300 Subject: Changes for building the all-in-one binary with Lua 5.4 --- src/luarocks/fs/tools.lua | 2 +- src/luarocks/fs/unix.lua | 3 ++- src/luarocks/fs/win32.lua | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/luarocks/fs/tools.lua b/src/luarocks/fs/tools.lua index 623e5a90..0a154794 100644 --- a/src/luarocks/fs/tools.lua +++ b/src/luarocks/fs/tools.lua @@ -57,7 +57,7 @@ do local current = cache_pwd if not current then local pipe = io.popen(fs.quiet_stderr(vars.PWD)) - current = pipe:read("*l"):gsub("%s*", "") + current = pipe:read("*a"):gsub("^%s*", ""):gsub("%s*$", "") pipe:close() cache_pwd = current end diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 2c66eaa3..0065753e 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua @@ -90,7 +90,8 @@ function unix.wrap_script(script, target, deps_mode, name, version, ...) } local remove_interpreter = false - if target == "luarocks" or target == "luarocks-admin" then + local base = dir.base_name(target):gsub("%..*$", "") + if base == "luarocks" or base == "luarocks-admin" then if cfg.is_binary then remove_interpreter = true end diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index 1902a691..a3f42df7 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua @@ -167,7 +167,8 @@ function win32.wrap_script(script, target, deps_mode, name, version, ...) } local remove_interpreter = false - if target == "luarocks" or target == "luarocks-admin" then + local base = dir.base_name(target):gsub("%..*$", "") + if base == "luarocks" or base == "luarocks-admin" then if cfg.is_binary then remove_interpreter = true end -- cgit v1.2.3-55-g6feb