diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-05 16:22:24 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-05 16:22:24 -0300 |
commit | 9ba78c0a7b9a3479174c74be612556aed0e21efb (patch) | |
tree | f59d6a5374c3f89579aa8ff46463d184d4d4d18b | |
parent | d379c973744c99ee9a07c7893de1b9c7a738ff6a (diff) | |
download | luarocks-9ba78c0a7b9a3479174c74be612556aed0e21efb.tar.gz luarocks-9ba78c0a7b9a3479174c74be612556aed0e21efb.tar.bz2 luarocks-9ba78c0a7b9a3479174c74be612556aed0e21efb.zip |
fix Windows cross-compilation hack
-rw-r--r-- | src/luarocks/cmd.lua | 12 | ||||
-rw-r--r-- | src/luarocks/fs.lua | 16 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 093fe768..36080eb9 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -438,18 +438,6 @@ function cmd.run_command(description, commands, external_namespace, ...) | |||
438 | -- Preliminary initialization | 438 | -- Preliminary initialization |
439 | cfg.init() | 439 | cfg.init() |
440 | 440 | ||
441 | -- FIXME A quick hack for the experimental Windows build | ||
442 | if os.getenv("LUAROCKS_CROSS_COMPILING") then | ||
443 | cfg.each_platform = function() | ||
444 | local i = 0 | ||
445 | local plats = { "unix", "linux" } | ||
446 | return function() | ||
447 | i = i + 1 | ||
448 | return plats[i] | ||
449 | end | ||
450 | end | ||
451 | end | ||
452 | |||
453 | fs.init() | 441 | fs.init() |
454 | 442 | ||
455 | for _, module_name in ipairs(fs.modules(external_namespace)) do | 443 | for _, module_name in ipairs(fs.modules(external_namespace)) do |
diff --git a/src/luarocks/fs.lua b/src/luarocks/fs.lua index 06f7e3fd..672d8991 100644 --- a/src/luarocks/fs.lua +++ b/src/luarocks/fs.lua | |||
@@ -61,7 +61,21 @@ do | |||
61 | end | 61 | end |
62 | 62 | ||
63 | local function load_platform_fns(patt, inits) | 63 | local function load_platform_fns(patt, inits) |
64 | for platform in cfg.each_platform("most-specific-first") do | 64 | local each_platform = cfg.each_platform |
65 | |||
66 | -- FIXME A quick hack for the experimental Windows build | ||
67 | if os.getenv("LUAROCKS_CROSS_COMPILING") then | ||
68 | each_platform = function() | ||
69 | local i = 0 | ||
70 | local plats = { "linux", "unix" } | ||
71 | return function() | ||
72 | i = i + 1 | ||
73 | return plats[i] | ||
74 | end | ||
75 | end | ||
76 | end | ||
77 | |||
78 | for platform in each_platform("most-specific-first") do | ||
65 | local ok, fs_plat = pcall(require, patt:format(platform)) | 79 | local ok, fs_plat = pcall(require, patt:format(platform)) |
66 | if ok and fs_plat then | 80 | if ok and fs_plat then |
67 | load_fns(fs_plat, inits) | 81 | load_fns(fs_plat, inits) |