aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--src/luarocks/fs/unix.lua4
-rw-r--r--src/luarocks/fs/win32.lua4
-rw-r--r--src/luarocks/path.lua2
4 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 3b0334c8..7a9eae1e 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ purge.lua path.lua write_rockspec.lua
28 28
29CONFIG_FILE = $(SYSCONFDIR)/config-$(LUA_VERSION).lua 29CONFIG_FILE = $(SYSCONFDIR)/config-$(LUA_VERSION).lua
30 30
31SAFEPWD=`echo "$$PWD" | sed -e 's/\([][]\)\1/]]..'\''\1\1'\''..[[/g' -` 31SAFEPWD=`echo "$$PWD" | sed -e 's/\([][]\)\1/]]..'\''\1\1'\''..[[/g'`
32 32
33all: 33all:
34 @echo "- Type 'make build' and 'make install':" 34 @echo "- Type 'make build' and 'make install':"
diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua
index 9dc3b6a6..d231222b 100644
--- a/src/luarocks/fs/unix.lua
+++ b/src/luarocks/fs/unix.lua
@@ -61,8 +61,8 @@ function wrap_script(file, dest, name, version)
61 wrapper:write("#!/bin/sh\n\n") 61 wrapper:write("#!/bin/sh\n\n")
62 local lua = dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter) 62 local lua = dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)
63 local ppaths = "package.path="..util.LQ(lpath..";").."..package.path; package.cpath="..util.LQ(lcpath..";").."..package.cpath" 63 local ppaths = "package.path="..util.LQ(lpath..";").."..package.path; package.cpath="..util.LQ(lcpath..";").."..package.cpath"
64 local addctx = "luarocks.loader.add_context("..util.LQ(name)..","..util.LQ(version)..")" 64 local addctx = "local k,l,_=pcall(require,"..util.LQ("luarocks.loader")..") _=k and l.add_context("..util.LQ(name)..","..util.LQ(version)..")"
65 wrapper:write('exec '..fs.Q(lua)..' -e '..fs.Q(ppaths)..' -lluarocks.loader -e '..fs.Q(addctx)..' '..fs.Q(file)..' "$@"\n') 65 wrapper:write('exec '..fs.Q(lua)..' -e '..fs.Q(ppaths)..' -e '..fs.Q(addctx)..' '..fs.Q(file)..' "$@"\n')
66 wrapper:close() 66 wrapper:close()
67 if fs.chmod(wrapname, "0755") then 67 if fs.chmod(wrapname, "0755") then
68 return true 68 return true
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua
index 78a9f730..0280b3f0 100644
--- a/src/luarocks/fs/win32.lua
+++ b/src/luarocks/fs/win32.lua
@@ -113,8 +113,8 @@ function wrap_script(file, dest, name, version)
113 wrapper:write("@echo off\n") 113 wrapper:write("@echo off\n")
114 local lua = dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter) 114 local lua = dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)
115 local ppaths = "package.path="..util.LQ(lpath..";").."..package.path; package.cpath="..util.LQ(lcpath..";").."..package.cpath" 115 local ppaths = "package.path="..util.LQ(lpath..";").."..package.path; package.cpath="..util.LQ(lcpath..";").."..package.cpath"
116 local addctx = "luarocks.loader.add_context("..util.LQ(name)..","..util.LQ(version)..")" 116 local addctx = "local k,l,_=pcall(require,"..util.LQ("luarocks.loader")..") _=k and l.add_context("..util.LQ(name)..","..util.LQ(version)..")"
117 wrapper:write(fs.Qb(lua)..' -e '..fs.Qb(ppaths)..' -lluarocks.loader -e '..fs.Qb(addctx)..' '..fs.Qb(file)..' %*\n') 117 wrapper:write(fs.Qb(lua)..' -e '..fs.Qb(ppaths)..' -e '..fs.Qb(addctx)..' '..fs.Qb(file)..' %*\n')
118 wrapper:close() 118 wrapper:close()
119 return true 119 return true
120end 120end
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index f5a7e9ed..f8ae15c0 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -336,7 +336,7 @@ function map_trees(deps_mode, fn, ...)
336 use = true 336 use = true
337 end 337 end
338 for _, tree in ipairs(cfg.rocks_trees) do 338 for _, tree in ipairs(cfg.rocks_trees) do
339 if dir.normalize(tree) == dir.normalize(cfg.root_dir) then 339 if dir.normalize(rocks_tree_to_string(tree)) == dir.normalize(rocks_tree_to_string(cfg.root_dir)) then
340 use = true 340 use = true
341 end 341 end
342 if use then 342 if use then