diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2013-08-28 20:34:54 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-08-28 20:34:54 -0300 |
| commit | 4744dc4520e9129a8c98b76c63d341e0e66a7ca0 (patch) | |
| tree | 3f52a4e3b5d351b8f0329e35c2d7c27a0f07ea7e | |
| parent | a4f62cb9245a8bf5ef6c7dcbca9dbcc997cca485 (diff) | |
| download | luarocks-4744dc4520e9129a8c98b76c63d341e0e66a7ca0.tar.gz luarocks-4744dc4520e9129a8c98b76c63d341e0e66a7ca0.tar.bz2 luarocks-4744dc4520e9129a8c98b76c63d341e0e66a7ca0.zip | |
Should fix installation of parallel LuaRocks versions when using 'make bootstrap' on both.
Thanks to Philipp Janda for the test case!
| -rw-r--r-- | Makefile | 7 | ||||
| -rw-r--r-- | src/luarocks/manif.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/repos.lua | 7 |
3 files changed, 13 insertions, 3 deletions
| @@ -168,6 +168,11 @@ write_sysconfig: built | |||
| 168 | install: install_bins install_luas install_site_config write_sysconfig | 168 | install: install_bins install_luas install_site_config write_sysconfig |
| 169 | 169 | ||
| 170 | bootstrap: src/luarocks/site_config.lua install_site_config write_sysconfig | 170 | bootstrap: src/luarocks/site_config.lua install_site_config write_sysconfig |
| 171 | LUA_PATH="$$PWD/src/?.lua;$$LUA_PATH" src/bin/luarocks make rockspec --tree="$(PREFIX)" | 171 | if [ -n "$$LUA_PATH_5_2" ] ;\ |
| 172 | then \ | ||
| 173 | LUA_PATH="$$PWD/src/?.lua;$$LUA_PATH" LUA_PATH_5_2="$$PWD/src/?.lua;$$LUA_PATH_5_2" src/bin/luarocks make rockspec --tree="$(PREFIX)" ;\ | ||
| 174 | else \ | ||
| 175 | LUA_PATH="$$PWD/src/?.lua;$$LUA_PATH" src/bin/luarocks make rockspec --tree="$(PREFIX)" ;\ | ||
| 176 | fi | ||
| 172 | 177 | ||
| 173 | install_rock: install_bins install_luas | 178 | install_rock: install_bins install_luas |
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index c17da71e..d0bd5e04 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
| @@ -403,7 +403,7 @@ local function find_providers(file, root) | |||
| 403 | 403 | ||
| 404 | local manifest, err = manif_core.load_local_manifest(path.rocks_dir(root)) | 404 | local manifest, err = manif_core.load_local_manifest(path.rocks_dir(root)) |
| 405 | if not manifest then | 405 | if not manifest then |
| 406 | return nil, err .. " -- corrupted local rocks tree?" | 406 | return nil, "untracked" |
| 407 | end | 407 | end |
| 408 | local deploy_bin = path.deploy_bin_dir(root) | 408 | local deploy_bin = path.deploy_bin_dir(root) |
| 409 | local deploy_lua = path.deploy_lua_dir(root) | 409 | local deploy_lua = path.deploy_lua_dir(root) |
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index c7b381df..23398cbb 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
| @@ -214,7 +214,12 @@ function deploy_files(name, version, wrap_bin_scripts) | |||
| 214 | if fs.exists(target) then | 214 | if fs.exists(target) then |
| 215 | local new_target, err = resolve_conflict(target, deploy_dir, name, version) | 215 | local new_target, err = resolve_conflict(target, deploy_dir, name, version) |
| 216 | if err == "untracked" then | 216 | if err == "untracked" then |
| 217 | fs.delete(target) | 217 | local backup = target |
| 218 | repeat | ||
| 219 | backup = target.."~" | ||
| 220 | until not fs.exists(backup) -- slight race condition here, but shouldn't be a problem. | ||
| 221 | util.printerr("Warning: "..target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) | ||
| 222 | fs.move(target, backup) | ||
| 218 | elseif err then | 223 | elseif err then |
| 219 | return nil, err.." Cannot install new version." | 224 | return nil, err.." Cannot install new version." |
| 220 | else | 225 | else |
