diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-25 19:49:47 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-25 19:49:47 -0300 |
| commit | 6f844bd4c21e5f4e52177b777a77f22d66748397 (patch) | |
| tree | da4956ddb531ce35735591ee3a8437bcad567485 | |
| parent | 7c8feab610fd956780c05700aac6d5d0b566da6d (diff) | |
| parent | cd53c994a71351c57d76f3eac463a40a3e3f6fed (diff) | |
| download | luarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.tar.gz luarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.tar.bz2 luarocks-6f844bd4c21e5f4e52177b777a77f22d66748397.zip | |
Merge branch 'master' into multitree
| -rw-r--r-- | src/luarocks/cfg.lua | 8 | ||||
| -rw-r--r-- | src/luarocks/path.lua | 4 |
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 | ||
| 101 | local version_suffix = lua_version:gsub ("%.", "_") | ||
| 101 | local sys_config_file, home_config_file | 102 | local sys_config_file, home_config_file |
| 102 | local sys_config_ok, home_config_ok = false, false | 103 | local sys_config_ok, home_config_ok = false, false |
| 104 | sys_config_file = site_config["LUAROCKS_SYSCONFIG_" .. version_suffix] or site_config.LUAROCKS_SYSCONFIG | ||
| 103 | if detected.windows then | 105 | if 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/" |
| 108 | else | 110 | else |
| 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/" |
| 113 | end | 115 | end |
| @@ -126,7 +128,7 @@ else -- nil or false | |||
| 126 | end | 128 | end |
| 127 | 129 | ||
| 128 | if not site_config.LUAROCKS_FORCE_CONFIG then | 130 | if 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 | |||
| 38 | function root_dir(rocks_dir) | 38 | function 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 .. ".*$") |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | function deploy_bin_dir(tree) | 45 | function deploy_bin_dir(tree) |
