aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--src/luarocks/cfg.lua5
-rw-r--r--src/luarocks/search.lua19
3 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index c8d1d972..35a366bd 100644
--- a/Makefile
+++ b/Makefile
@@ -136,9 +136,6 @@ write_sysconfig: built
136 if [ ! -f "$(DESTDIR)$(CONFIG_FILE)" ] ;\ 136 if [ ! -f "$(DESTDIR)$(CONFIG_FILE)" ] ;\
137 then \ 137 then \
138 mkdir -p `dirname "$(DESTDIR)$(CONFIG_FILE)"` ;\ 138 mkdir -p `dirname "$(DESTDIR)$(CONFIG_FILE)"` ;\
139 echo 'rocks_servers = {' >> "$(DESTDIR)$(CONFIG_FILE)" ;\
140 echo ' [[http://luarocks.org/repositories/rocks]]' >> "$(DESTDIR)$(CONFIG_FILE)" ;\
141 echo '}' >> "$(DESTDIR)$(CONFIG_FILE)" ;\
142 echo 'rocks_trees = {' >> "$(DESTDIR)$(CONFIG_FILE)" ;\ 139 echo 'rocks_trees = {' >> "$(DESTDIR)$(CONFIG_FILE)" ;\
143 if [ ! -n "$(FORCE_CONFIG)" ] ;\ 140 if [ ! -n "$(FORCE_CONFIG)" ] ;\
144 then \ 141 then \
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index efe5de36..263af063 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -171,7 +171,10 @@ local defaults = {
171 obj_extension = "unknown", 171 obj_extension = "unknown",
172 172
173 rocks_servers = { 173 rocks_servers = {
174 "http://www.luarocks.org/repositories/rocks" 174 {
175 "http://www.luarocks.org/repositories/rocks",
176 "http://luarocks.giga.puc-rio.br/"
177 }
175 }, 178 },
176 179
177 lua_extension = "lua", 180 lua_extension = "lua",
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua
index 5df2bd38..9c53632a 100644
--- a/src/luarocks/search.lua
+++ b/src/luarocks/search.lua
@@ -194,13 +194,20 @@ function search_repos(query)
194 194
195 local results = {} 195 local results = {}
196 for _, repo in ipairs(cfg.rocks_servers) do 196 for _, repo in ipairs(cfg.rocks_servers) do
197 local protocol, pathname = dir.split_url(repo) 197 if type(repo) == "string" then
198 if protocol == "file" then 198 repo = { repo }
199 repo = pathname
200 end 199 end
201 local ok, err = manifest_search(results, repo, query) 200 for _, mirror in ipairs(repo) do
202 if not ok then 201 local protocol, pathname = dir.split_url(mirror)
203 util.warning("Failed searching manifest: "..err) 202 if protocol == "file" then
203 mirror = pathname
204 end
205 local ok, err = manifest_search(results, mirror, query)
206 if ok then
207 break
208 else
209 util.warning("Failed searching manifest: "..err)
210 end
204 end 211 end
205 end 212 end
206 return results 213 return results