aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2013-11-11 13:30:36 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2013-11-11 13:30:36 +0100
commit7bd1a6549d1f2118838e0ee513f163d025af2a20 (patch)
tree45b0384b9b1c00d5516cb69df81cc535220c1311
parentf3fae7c816bba9da85fbd42725933d94444aceef (diff)
downloadluarocks-7bd1a6549d1f2118838e0ee513f163d025af2a20.tar.gz
luarocks-7bd1a6549d1f2118838e0ee513f163d025af2a20.tar.bz2
luarocks-7bd1a6549d1f2118838e0ee513f163d025af2a20.zip
fixed command line parameters with spaces
reorganized help description fixed whitespace
-rw-r--r--install.bat69
1 files changed, 41 insertions, 28 deletions
diff --git a/install.bat b/install.bat
index f6601aa8..2d102f7c 100644
--- a/install.bat
+++ b/install.bat
@@ -68,18 +68,16 @@ Installs LuaRocks.
68/P [dir] (REQUIRED) Where to install. 68/P [dir] (REQUIRED) Where to install.
69 Note that version; $VERSION, will be 69 Note that version; $VERSION, will be
70 appended to this path. 70 appended to this path.
71/CONFIG [dir] Location where the config file should be installed. 71
72 Default is same place of installation 72Configuring the destinations:
73/TREE [dir] Root of the local tree of installed rocks. 73/TREE [dir] Root of the local tree of installed rocks.
74 Default is same place of installation 74 Default is same place of installation
75/SCRIPTS [dir] Where to install scripts installed by rocks. 75/SCRIPTS [dir] Where to install commandline scripts installed by
76 Default is TREE/bin. 76 rocks. Default is TREE/bin.
77 77
78Configuring the Lua interpreter:
78/LV [version] Lua version to use; either 5.1 or 5.2. 79/LV [version] Lua version to use; either 5.1 or 5.2.
79 Default is 5.1 80 Default is 5.1
80/L Install LuaRocks' own copy of Lua even if detected,
81 this will always be a 5.1 installation.
82 (/LUA, /INC, /LIB, /BIN cannot be used with /L)
83/LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ 81/LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\
84 This is the base directory, the installer will look 82 This is the base directory, the installer will look
85 for subdirectories bin, lib, include. Alternatively 83 for subdirectories bin, lib, include. Alternatively
@@ -87,20 +85,25 @@ Installs LuaRocks.
87 /LIB, and /BIN options. 85 /LIB, and /BIN options.
88/INC [dir] Location of Lua includes - e.g. c:\lua\5.1\include 86/INC [dir] Location of Lua includes - e.g. c:\lua\5.1\include
89 If provided overrides sub directory found using /LUA. 87 If provided overrides sub directory found using /LUA.
90/LIB [dir] Location of Lua libraries -e.g. c:\lua\5.1\lib 88/LIB [dir] Location of Lua libraries (.dll) - e.g. c:\lua\5.1\lib
91 If provided overrides sub directory found using /LUA. 89 If provided overrides sub directory found using /LUA.
92/BIN [dir] Location of Lua executables - e.g. c:\lua\5.1\bin 90/BIN [dir] Location of Lua executables - e.g. c:\lua\5.1\bin
93 If provided overrides sub directory found using /LUA. 91 If provided overrides sub directory found using /LUA.
92/L Install LuaRocks' own copy of Lua even if detected,
93 this will always be a 5.1 installation.
94 (/LUA, /INC, /LIB, /BIN cannot be used with /L)
94 95
96Compiler configuration:
95/MW Use mingw as build system instead of MSVC 97/MW Use mingw as build system instead of MSVC
96 98
99Other options:
100/CONFIG [dir] Location where the config file should be installed.
101 Default is same place of installation
97/FORCECONFIG Use a single config location. Do not use the 102/FORCECONFIG Use a single config location. Do not use the
98 LUAROCKS_CONFIG variable or the user's home directory. 103 LUAROCKS_CONFIG variable or the user's home directory.
99 Useful to avoid conflicts when LuaRocks 104 Useful to avoid conflicts when LuaRocks
100 is embedded within an application. 105 is embedded within an application.
101
102/F Remove installation directory if it already exists. 106/F Remove installation directory if it already exists.
103
104/R Load registry information to register '.rockspec' 107/R Load registry information to register '.rockspec'
105 extension with LuaRocks commands (right-click). 108 extension with LuaRocks commands (right-click).
106 109
@@ -197,7 +200,7 @@ local function look_for_interpreter (directory)
197 print(S" Found $LUA_BINDIR\\$LUA_INTERPRETER") 200 print(S" Found $LUA_BINDIR\\$LUA_INTERPRETER")
198 return true 201 return true
199 end 202 end
200 die(S"Lua executable lua.exe, luajit.exe or lua$LUA_VERSION.exe not found in $LUA_BINDIR") 203 die(S"Lua executable lua.exe, luajit.exe, lua$LUA_SHORTV.exe or lua$LUA_VERSION.exe not found in $LUA_BINDIR")
201 end 204 end
202 205
203 for _, e in ipairs{ [[\]], [[\bin\]] } do 206 for _, e in ipairs{ [[\]], [[\bin\]] } do
@@ -280,31 +283,31 @@ end
280 283
281 284
282local function get_runtime() 285local function get_runtime()
283 local f 286 local f
284 vars.LUA_RUNTIME, f = pe.msvcrt(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER) 287 vars.LUA_RUNTIME, f = pe.msvcrt(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER)
285 if type(vars.LUA_RUNTIME) ~= "string" then 288 if type(vars.LUA_RUNTIME) ~= "string" then
286 -- analysis failed, issue a warning 289 -- analysis failed, issue a warning
287 vars.LUA_RUNTIME = "MSVCR80" 290 vars.LUA_RUNTIME = "MSVCR80"
288 print("*** WARNING ***: could not analyse the runtime used, defaulting to "..vars.LUA_RUNTIME) 291 print("*** WARNING ***: could not analyse the runtime used, defaulting to "..vars.LUA_RUNTIME)
289 else 292 else
290 print(" "..f.." uses "..vars.LUA_RUNTIME..".DLL as runtime") 293 print(" "..f.." uses "..vars.LUA_RUNTIME..".DLL as runtime")
291 end 294 end
292 return true 295 return true
293end 296end
294 297
295local function get_architecture() 298local function get_architecture()
296 -- detect processor arch interpreter was compiled for 299 -- detect processor arch interpreter was compiled for
297 local proc = (pe.parse(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER) or {}).Machine 300 local proc = (pe.parse(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER) or {}).Machine
298 if not proc then 301 if not proc then
299 die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER) 302 die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER)
300 end 303 end
301 proc = pe.const.Machine[proc] -- collect name from constant value 304 proc = pe.const.Machine[proc] -- collect name from constant value
302 if proc == "IMAGE_FILE_MACHINE_I386" then 305 if proc == "IMAGE_FILE_MACHINE_I386" then
303 proc = "x86" 306 proc = "x86"
304 else 307 else
305 proc = "x86_64" 308 proc = "x86_64"
306 end 309 end
307 return proc 310 return proc
308end 311end
309 312
310local function look_for_lua_install () 313local function look_for_lua_install ()
@@ -369,6 +372,16 @@ local with_arg = { -- options followed by an argument, others are flags
369 ["/BIN"] = true, 372 ["/BIN"] = true,
370 ["/LIB"] = true, 373 ["/LIB"] = true,
371} 374}
375-- reconstruct argument values with spaces
376if #arg > 1 then
377 for i = #arg - 1, 1, -1 do
378 if (arg[i]:sub(1,1) ~= "/") and (arg[i+1]:sub(1,1) ~= "/") then
379 arg[i] = arg[i].." "..arg[i+1]
380 table.remove(arg, i+1)
381 end
382 end
383end
384
372local i = 1 385local i = 1
373while i <= #arg do 386while i <= #arg do
374 local opt = arg[i] 387 local opt = arg[i]
@@ -409,10 +422,10 @@ if not look_for_lua_install() then
409 vars.LUA_LIBDIR = vars.LIBDIR 422 vars.LUA_LIBDIR = vars.LIBDIR
410 vars.LUA_INCDIR = vars.INCDIR 423 vars.LUA_INCDIR = vars.INCDIR
411 vars.LUA_LIBNAME = "lua5.1.lib" 424 vars.LUA_LIBNAME = "lua5.1.lib"
412 vars.LUA_RUNTIME = "MSVCR80" 425 vars.LUA_RUNTIME = "MSVCR80"
413 vars.UNAME_M = "x86" 426 vars.UNAME_M = "x86"
414else 427else
415 vars.UNAME_M = get_architecture() 428 vars.UNAME_M = get_architecture()
416 print(S[[ 429 print(S[[
417 430
418Will configure LuaRocks with the following paths: 431Will configure LuaRocks with the following paths: