diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cfg.lua | 14 | ||||
-rw-r--r-- | src/luarocks/help.lua | 14 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index af1062f8..1147d725 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -114,8 +114,11 @@ rocks_trees = {} | |||
114 | local ok, err = persist.load_into_table(site_config.LUAROCKS_SYSCONFIG or sys_config_file, _M) | 114 | local ok, err = persist.load_into_table(site_config.LUAROCKS_SYSCONFIG or sys_config_file, _M) |
115 | if ok then | 115 | if ok then |
116 | sys_config_ok = true | 116 | sys_config_ok = true |
117 | elseif err and ok == nil then | 117 | else -- nil or false |
118 | io.stderr:write(err.."\n") | 118 | sys_config_ok = ok |
119 | if err and ok == nil then | ||
120 | io.stderr:write(err.."\n") | ||
121 | end | ||
119 | end | 122 | end |
120 | 123 | ||
121 | if not site_config.LUAROCKS_FORCE_CONFIG then | 124 | if not site_config.LUAROCKS_FORCE_CONFIG then |
@@ -131,8 +134,11 @@ if not site_config.LUAROCKS_FORCE_CONFIG then | |||
131 | _M.rocks_servers = nil | 134 | _M.rocks_servers = nil |
132 | end | 135 | end |
133 | util.deep_merge(_M, home_overrides) | 136 | util.deep_merge(_M, home_overrides) |
134 | elseif err and home_overrides == nil then | 137 | else -- nil or false |
135 | io.stderr:write(err.."\n") | 138 | home_config_ok = home_overrides |
139 | if err and home_config_ok == nil then | ||
140 | io.stderr:write(err.."\n") | ||
141 | end | ||
136 | end | 142 | end |
137 | end | 143 | end |
138 | 144 | ||
diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 3a366f44..19cd7914 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua | |||
@@ -24,6 +24,16 @@ local function print_section(section) | |||
24 | util.printout("\n"..section) | 24 | util.printout("\n"..section) |
25 | end | 25 | end |
26 | 26 | ||
27 | local function get_status(status) | ||
28 | if status then | ||
29 | return "ok" | ||
30 | elseif status == false then | ||
31 | return "not found" | ||
32 | else | ||
33 | return "failed" | ||
34 | end | ||
35 | end | ||
36 | |||
27 | --- Driver function for the "help" command. | 37 | --- Driver function for the "help" command. |
28 | -- @param command string or nil: command to show help for; if not | 38 | -- @param command string or nil: command to show help for; if not |
29 | -- given, help summaries for all commands are shown. | 39 | -- given, help summaries for all commands are shown. |
@@ -68,8 +78,8 @@ function run(...) | |||
68 | end | 78 | end |
69 | print_section("CONFIGURATION") | 79 | print_section("CONFIGURATION") |
70 | util.printout([[ | 80 | util.printout([[ |
71 | Using system configuration file: ]]..sys_file .. " (" .. (sys_ok and "ok" or "failed") ..[[) | 81 | System configuration file: ]]..sys_file .. " (" .. get_status(sys_ok) ..[[) |
72 | and user configuration file: ]]..home_file .. " (" .. (home_ok and "ok" or "failed") ..")\n") | 82 | User configuration file: ]]..home_file .. " (" .. get_status(home_ok) ..")\n") |
73 | else | 83 | else |
74 | command = command:gsub("-", "_") | 84 | command = command:gsub("-", "_") |
75 | if commands[command] then | 85 | if commands[command] then |