aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-09-25 19:49:47 -0300
committerHisham Muhammad <hisham@gobolinux.org>2012-09-25 19:49:47 -0300
commit6f844bd4c21e5f4e52177b777a77f22d66748397 (patch)
treeda4956ddb531ce35735591ee3a8437bcad567485 /src
parent7c8feab610fd956780c05700aac6d5d0b566da6d (diff)
parentcd53c994a71351c57d76f3eac463a40a3e3f6fed (diff)
downloadluarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.tar.gz
luarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.tar.bz2
luarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.zip
Merge branch 'master' into multitree
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cfg.lua8
-rw-r--r--src/luarocks/path.lua4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 330fabca..a05c6d51 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -98,16 +98,18 @@ end
98 98
99-- Path configuration: 99-- Path configuration:
100 100
101local version_suffix = lua_version:gsub ("%.", "_")
101local sys_config_file, home_config_file 102local sys_config_file, home_config_file
102local sys_config_ok, home_config_ok = false, false 103local sys_config_ok, home_config_ok = false, false
104sys_config_file = site_config["LUAROCKS_SYSCONFIG_" .. version_suffix] or site_config.LUAROCKS_SYSCONFIG
103if detected.windows then 105if detected.windows then
104 home = os.getenv("APPDATA") or "c:" 106 home = os.getenv("APPDATA") or "c:"
105 sys_config_file = site_config.LUAROCKS_SYSCONFIG or "c:/luarocks/config.lua" 107 sys_config_file = sys_config_file or "c:/luarocks/config.lua"
106 home_config_file = home.."/luarocks/config.lua" 108 home_config_file = home.."/luarocks/config.lua"
107 home_tree = home.."/luarocks/" 109 home_tree = home.."/luarocks/"
108else 110else
109 home = os.getenv("HOME") or "" 111 home = os.getenv("HOME") or ""
110 sys_config_file = site_config.LUAROCKS_SYSCONFIG or "/etc/luarocks/config.lua" 112 sys_config_file = sys_config_file or "/etc/luarocks/config.lua"
111 home_config_file = home.."/.luarocks/config.lua" 113 home_config_file = home.."/.luarocks/config.lua"
112 home_tree = home.."/.luarocks/" 114 home_tree = home.."/.luarocks/"
113end 115end
@@ -126,7 +128,7 @@ else -- nil or false
126end 128end
127 129
128if not site_config.LUAROCKS_FORCE_CONFIG then 130if not site_config.LUAROCKS_FORCE_CONFIG then
129 home_config_file = os.getenv("LUAROCKS_CONFIG") or home_config_file 131 home_config_file = os.getenv("LUAROCKS_CONFIG_" .. version_suffix) or os.getenv("LUAROCKS_CONFIG") or home_config_file
130 local home_overrides, err = persist.load_into_table(home_config_file, { home = home }) 132 local home_overrides, err = persist.load_into_table(home_config_file, { home = home })
131 if home_overrides then 133 if home_overrides then
132 home_config_ok = true 134 home_config_ok = true
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua
index e613d112..42d3b8f1 100644
--- a/src/luarocks/path.lua
+++ b/src/luarocks/path.lua
@@ -38,8 +38,8 @@ end
38function root_dir(rocks_dir) 38function root_dir(rocks_dir)
39 assert(type(rocks_dir) == "string") 39 assert(type(rocks_dir) == "string")
40 40
41 local suffix = dir.path("lib", "luarocks", "rocks") 41 local suffix = dir.path("lib", "luarocks")
42 return rocks_dir:match("(.*)" .. suffix .. "$") 42 return rocks_dir:match("(.*)" .. suffix .. ".*$")
43end 43end
44 44
45function deploy_bin_dir(tree) 45function deploy_bin_dir(tree)