diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-19 20:21:39 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-19 20:21:39 -0300 |
commit | 45b5a1e2a7cbdadfa57f9b895cacc162eff9211c (patch) | |
tree | e827a2a623eab296ac51788a24e7ae6a396723b9 | |
parent | e44bee9563f69b992acd55ca05f20d9b2b60eb00 (diff) | |
download | luarocks-45b5a1e2a7cbdadfa57f9b895cacc162eff9211c.tar.gz luarocks-45b5a1e2a7cbdadfa57f9b895cacc162eff9211c.tar.bz2 luarocks-45b5a1e2a7cbdadfa57f9b895cacc162eff9211c.zip |
Do not use Lua modules tools while on Windows. Should help with #42. Any feedback is welcome.
-rw-r--r-- | src/luarocks/cfg.lua | 3 | ||||
-rw-r--r-- | src/luarocks/fs/lua.lua | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index e0b4060a..c904a7ba 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -162,6 +162,7 @@ local defaults = { | |||
162 | local_by_default = false, | 162 | local_by_default = false, |
163 | use_extensions = false, | 163 | use_extensions = false, |
164 | accept_unknown_fields = false, | 164 | accept_unknown_fields = false, |
165 | fs_use_modules = true, | ||
165 | 166 | ||
166 | lua_modules_path = "/share/lua/"..lua_version, | 167 | lua_modules_path = "/share/lua/"..lua_version, |
167 | lib_modules_path = "/lib/lua/"..lua_version, | 168 | lib_modules_path = "/lib/lua/"..lua_version, |
@@ -240,6 +241,7 @@ local defaults = { | |||
240 | 241 | ||
241 | if detected.windows then | 242 | if detected.windows then |
242 | home_config_file = home_config_file:gsub("\\","/") | 243 | home_config_file = home_config_file:gsub("\\","/") |
244 | defaults.fs_use_modules = false | ||
243 | defaults.arch = "win32-"..proc | 245 | defaults.arch = "win32-"..proc |
244 | defaults.platforms = {"win32", "windows" } | 246 | defaults.platforms = {"win32", "windows" } |
245 | defaults.lib_extension = "dll" | 247 | defaults.lib_extension = "dll" |
@@ -278,6 +280,7 @@ end | |||
278 | 280 | ||
279 | if detected.mingw32 then | 281 | if detected.mingw32 then |
280 | home_config_file = home_config_file:gsub("\\","/") | 282 | home_config_file = home_config_file:gsub("\\","/") |
283 | defaults.fs_use_modules = false | ||
281 | defaults.arch = "win32-"..proc | 284 | defaults.arch = "win32-"..proc |
282 | defaults.platforms = { "win32", "mingw32" } | 285 | defaults.platforms = { "win32", "mingw32" } |
283 | defaults.lib_extension = "dll" | 286 | defaults.lib_extension = "dll" |
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 2231dde5..c413ccb3 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
@@ -10,13 +10,18 @@ local dir = require("luarocks.dir") | |||
10 | local util = require("luarocks.util") | 10 | local util = require("luarocks.util") |
11 | local path = require("luarocks.path") | 11 | local path = require("luarocks.path") |
12 | 12 | ||
13 | local socket_ok, http = pcall(require, "socket.http") | 13 | local socket_ok, zip_ok, unzip_ok, lfs_ok, md5_ok, posix_ok, _ |
14 | local _, ftp = pcall(require, "socket.ftp") | 14 | local http, ftp, lrzip, luazip, lfs, md5, posix |
15 | local zip_ok, lrzip = pcall(require, "luarocks.tools.zip") | 15 | |
16 | local unzip_ok, luazip = pcall(require, "zip"); _G.zip = nil | 16 | if cfg.fs_use_modules then |
17 | local lfs_ok, lfs = pcall(require, "lfs") | 17 | socket_ok, http = pcall(require, "socket.http") |
18 | local md5_ok, md5 = pcall(require, "md5") | 18 | _, ftp = pcall(require, "socket.ftp") |
19 | local posix_ok, posix = pcall(require, "posix") | 19 | zip_ok, lrzip = pcall(require, "luarocks.tools.zip") |
20 | unzip_ok, luazip = pcall(require, "zip"); _G.zip = nil | ||
21 | lfs_ok, lfs = pcall(require, "lfs") | ||
22 | md5_ok, md5 = pcall(require, "md5") | ||
23 | posix_ok, posix = pcall(require, "posix") | ||
24 | end | ||
20 | 25 | ||
21 | local tar = require("luarocks.tools.tar") | 26 | local tar = require("luarocks.tools.tar") |
22 | local patch = require("luarocks.tools.patch") | 27 | local patch = require("luarocks.tools.patch") |