aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFabio Mascarenhas <mascarenhas@lambda-2.local>2010-01-15 20:37:46 -0200
committerFabio Mascarenhas <mascarenhas@lambda-2.local>2010-01-15 20:37:46 -0200
commit3364429deccef52024ed5b0384d70d78dedd2fe7 (patch)
treee87a7403fb9ec0cd2206f083b14d143b35116c4d /src
parent69a6a162a0def6a52252bbcae3fc747dfd4268aa (diff)
downloadluarocks-3364429deccef52024ed5b0384d70d78dedd2fe7.tar.gz
luarocks-3364429deccef52024ed5b0384d70d78dedd2fe7.tar.bz2
luarocks-3364429deccef52024ed5b0384d70d78dedd2fe7.zip
bugfixes, new rclauncher
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/build/builtin.lua14
-rw-r--r--src/luarocks/fs/win32.lua1
2 files changed, 9 insertions, 6 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua
index d04b69d5..b874b82d 100644
--- a/src/luarocks/build/builtin.lua
+++ b/src/luarocks/build/builtin.lua
@@ -36,18 +36,20 @@ local function make_rc(luafilename, rcfilename)
36 if not rcfile then 36 if not rcfile then
37 error("Could not open "..rcfilename.." for writing.") 37 error("Could not open "..rcfilename.." for writing.")
38 end 38 end
39 rcfile:write("#define IDS_RCLAUNCHER 1\r\n")
40 rcfile:write("STRINGTABLE\r\nBEGIN\r\n") 39 rcfile:write("STRINGTABLE\r\nBEGIN\r\n")
41 rcfile:write("IDS_RCLAUNCHER \"")
42 40
41 local i = 1
43 for line in io.lines(luafilename) do 42 for line in io.lines(luafilename) do
44 if not line:match("^#!") then 43 if not line:match("^#!") then
44 rcfile:write(i .. " \"")
45 line = line:gsub("\\", "\\\\"):gsub('"', '""'):gsub("[\r\n]+", "") 45 line = line:gsub("\\", "\\\\"):gsub('"', '""'):gsub("[\r\n]+", "")
46 rcfile:write(line .. "\\n\\\r\n") 46 rcfile:write(line .. "\\r\\n\"\r\n")
47 i = i + 1
47 end 48 end
48 end 49 end
49 50
50 rcfile:write("\"\r\nEND\r\n") 51 rcfile:write("END\r\n")
52
51 rcfile:close() 53 rcfile:close()
52end 54end
53 55
@@ -108,7 +110,7 @@ function run(rockspec)
108 local ok = execute(variables.RC, "-r", "-fo"..resname, rcname) 110 local ok = execute(variables.RC, "-r", "-fo"..resname, rcname)
109 if not ok then return ok end 111 if not ok then return ok end
110 ok = execute(variables.LD, "-out:"..wrapname, resname, variables.WRAPPER, 112 ok = execute(variables.LD, "-out:"..wrapname, resname, variables.WRAPPER,
111 fs.make_path(variables.LUA_LIBDIR, "lua5.1.lib"), "user32.lib") 113 dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "user32.lib")
112 local manifestfile = wrapname..".manifest" 114 local manifestfile = wrapname..".manifest"
113 if ok and fs.exists(manifestfile) then 115 if ok and fs.exists(manifestfile) then
114 ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..wrapname..";1") 116 ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..wrapname..";1")
@@ -144,7 +146,7 @@ function run(rockspec)
144 -- otherwise just appends .exe to the name 146 -- otherwise just appends .exe to the name
145 if build.install and build.install.bin then 147 if build.install and build.install.bin then
146 for i, name in ipairs(build.install.bin) do 148 for i, name in ipairs(build.install.bin) do
147 local fullname = fs.make_path(fs.current_dir(), name) 149 local fullname = dir.path(fs.current_dir(), name)
148 local match = name:match("%.lua$") 150 local match = name:match("%.lua$")
149 local basename = name:gsub("%.lua$", "") 151 local basename = name:gsub("%.lua$", "")
150 local file 152 local file
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua
index 87ad26b2..d87ad90d 100644
--- a/src/luarocks/fs/win32.lua
+++ b/src/luarocks/fs/win32.lua
@@ -81,6 +81,7 @@ function copy_binary(filename, dest)
81 end 81 end
82 local exe_pattern = "%.[Ee][Xx][Ee]$" 82 local exe_pattern = "%.[Ee][Xx][Ee]$"
83 local base = dir.base_name(filename) 83 local base = dir.base_name(filename)
84 local dest = dir.dir_name(dest)
84 if base:match(exe_pattern) then 85 if base:match(exe_pattern) then
85 base = base:gsub(exe_pattern, ".lua") 86 base = base:gsub(exe_pattern, ".lua")
86 local helpname = dest.."/"..base 87 local helpname = dest.."/"..base