aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-09-19 20:27:27 -0300
committerHisham Muhammad <hisham@gobolinux.org>2012-09-19 20:27:27 -0300
commitd0998183ca95077b81fa7c31a48cb74b282fd858 (patch)
tree37f8258b53b0726e810ce76cb3e310028a931c01
parent45b5a1e2a7cbdadfa57f9b895cacc162eff9211c (diff)
downloadluarocks-d0998183ca95077b81fa7c31a48cb74b282fd858.tar.gz
luarocks-d0998183ca95077b81fa7c31a48cb74b282fd858.tar.bz2
luarocks-d0998183ca95077b81fa7c31a48cb74b282fd858.zip
Rename luarocks.rep to luarocks.repos. Closes #45.
-rw-r--r--src/luarocks/build.lua12
-rw-r--r--src/luarocks/install.lua12
-rw-r--r--src/luarocks/manif.lua10
-rw-r--r--src/luarocks/pack.lua4
-rw-r--r--src/luarocks/remove.lua4
-rw-r--r--src/luarocks/repos.lua (renamed from src/luarocks/rep.lua)2
-rw-r--r--src/luarocks/search.lua8
-rw-r--r--src/luarocks/show.lua4
8 files changed, 28 insertions, 28 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua
index e9b3adc1..6ffa0e79 100644
--- a/src/luarocks/build.lua
+++ b/src/luarocks/build.lua
@@ -6,7 +6,7 @@ module("luarocks.build", package.seeall)
6local pack = require("luarocks.pack") 6local pack = require("luarocks.pack")
7local path = require("luarocks.path") 7local path = require("luarocks.path")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9local rep = require("luarocks.rep") 9local repos = require("luarocks.repos")
10local fetch = require("luarocks.fetch") 10local fetch = require("luarocks.fetch")
11local fs = require("luarocks.fs") 11local fs = require("luarocks.fs")
12local dir = require("luarocks.dir") 12local dir = require("luarocks.dir")
@@ -142,8 +142,8 @@ function build_rockspec(rockspec_file, need_to_fetch, minimal_mode, no_deps)
142 end 142 end
143 143
144 local name, version = rockspec.name, rockspec.version 144 local name, version = rockspec.name, rockspec.version
145 if rep.is_installed(name, version) then 145 if repos.is_installed(name, version) then
146 rep.delete_version(name, version) 146 repos.delete_version(name, version)
147 end 147 end
148 148
149 if not minimal_mode then 149 if not minimal_mode then
@@ -242,15 +242,15 @@ function build_rockspec(rockspec_file, need_to_fetch, minimal_mode, no_deps)
242 ok, err = manif.make_rock_manifest(name, version) 242 ok, err = manif.make_rock_manifest(name, version)
243 if err then return nil, err end 243 if err then return nil, err end
244 244
245 ok, err = rep.deploy_files(name, version, rep.should_wrap_bin_scripts(rockspec)) 245 ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec))
246 if err then return nil, err end 246 if err then return nil, err end
247 247
248 util.remove_scheduled_function(rollback) 248 util.remove_scheduled_function(rollback)
249 rollback = util.schedule_function(function() 249 rollback = util.schedule_function(function()
250 rep.delete_version(name, version) 250 repos.delete_version(name, version)
251 end) 251 end)
252 252
253 ok, err = rep.run_hook(rockspec, "post_install") 253 ok, err = repos.run_hook(rockspec, "post_install")
254 if err then return nil, err end 254 if err then return nil, err end
255 255
256 ok, err = manif.update_manifest(name, version) 256 ok, err = manif.update_manifest(name, version)
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua
index 0a779b86..6b5ea85f 100644
--- a/src/luarocks/install.lua
+++ b/src/luarocks/install.lua
@@ -4,7 +4,7 @@
4module("luarocks.install", package.seeall) 4module("luarocks.install", package.seeall)
5 5
6local path = require("luarocks.path") 6local path = require("luarocks.path")
7local rep = require("luarocks.rep") 7local repos = require("luarocks.repos")
8local fetch = require("luarocks.fetch") 8local fetch = require("luarocks.fetch")
9local util = require("luarocks.util") 9local util = require("luarocks.util")
10local fs = require("luarocks.fs") 10local fs = require("luarocks.fs")
@@ -37,8 +37,8 @@ function install_binary_rock(rock_file, no_deps)
37 if arch ~= "all" and arch ~= cfg.arch then 37 if arch ~= "all" and arch ~= cfg.arch then
38 return nil, "Incompatible architecture "..arch, "arch" 38 return nil, "Incompatible architecture "..arch, "arch"
39 end 39 end
40 if rep.is_installed(name, version) then 40 if repos.is_installed(name, version) then
41 rep.delete_version(name, version) 41 repos.delete_version(name, version)
42 end 42 end
43 43
44 local rollback = util.schedule_function(function() 44 local rollback = util.schedule_function(function()
@@ -77,15 +77,15 @@ function install_binary_rock(rock_file, no_deps)
77 wrap_bin_scripts = false 77 wrap_bin_scripts = false
78 end 78 end
79 79
80 ok, err = rep.deploy_files(name, version, rep.should_wrap_bin_scripts(rockspec)) 80 ok, err = repos.deploy_files(name, version, repos.should_wrap_bin_scripts(rockspec))
81 if err then return nil, err end 81 if err then return nil, err end
82 82
83 util.remove_scheduled_function(rollback) 83 util.remove_scheduled_function(rollback)
84 rollback = util.schedule_function(function() 84 rollback = util.schedule_function(function()
85 rep.delete_version(name, version) 85 repos.delete_version(name, version)
86 end) 86 end)
87 87
88 ok, err = rep.run_hook(rockspec, "post_install") 88 ok, err = repos.run_hook(rockspec, "post_install")
89 if err then return nil, err end 89 if err then return nil, err end
90 90
91 ok, err = manif.update_manifest(name, version) 91 ok, err = manif.update_manifest(name, version)
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua
index 6b05b749..2c745f0b 100644
--- a/src/luarocks/manif.lua
+++ b/src/luarocks/manif.lua
@@ -14,7 +14,7 @@ local search = require("luarocks.search")
14local util = require("luarocks.util") 14local util = require("luarocks.util")
15local cfg = require("luarocks.cfg") 15local cfg = require("luarocks.cfg")
16local path = require("luarocks.path") 16local path = require("luarocks.path")
17local rep = require("luarocks.rep") 17local repos = require("luarocks.repos")
18local deps = require("luarocks.deps") 18local deps = require("luarocks.deps")
19 19
20rock_manifest_cache = {} 20rock_manifest_cache = {}
@@ -187,9 +187,9 @@ end
187-- @param manifest table: a manifest table. 187-- @param manifest table: a manifest table.
188local function update_dependencies(manifest) 188local function update_dependencies(manifest)
189 for pkg, versions in pairs(manifest.repository) do 189 for pkg, versions in pairs(manifest.repository) do
190 for version, repos in pairs(versions) do 190 for version, repositories in pairs(versions) do
191 local current = pkg.." "..version 191 local current = pkg.." "..version
192 for _, repo in ipairs(repos) do 192 for _, repo in ipairs(repositories) do
193 if repo.arch == "installed" then 193 if repo.arch == "installed" then
194 local missing 194 local missing
195 repo.dependencies, missing = deps.scan_deps({}, {}, manifest, pkg, version) 195 repo.dependencies, missing = deps.scan_deps({}, {}, manifest, pkg, version)
@@ -230,8 +230,8 @@ local function store_results(results, manifest)
230 if not rock_manifest then 230 if not rock_manifest then
231 return nil, "rock_manifest file not found for "..name.." "..version.." - not a LuaRocks 2 tree?" 231 return nil, "rock_manifest file not found for "..name.." "..version.." - not a LuaRocks 2 tree?"
232 end 232 end
233 entrytable.modules = store_package_items(rep.package_modules, name, version, manifest.modules) 233 entrytable.modules = store_package_items(repos.package_modules, name, version, manifest.modules)
234 entrytable.commands = store_package_items(rep.package_commands, name, version, manifest.commands) 234 entrytable.commands = store_package_items(repos.package_commands, name, version, manifest.commands)
235 end 235 end
236 table.insert(versiontable, entrytable) 236 table.insert(versiontable, entrytable)
237 end 237 end
diff --git a/src/luarocks/pack.lua b/src/luarocks/pack.lua
index f7a7ad12..d8f0b2ef 100644
--- a/src/luarocks/pack.lua
+++ b/src/luarocks/pack.lua
@@ -4,7 +4,7 @@
4module("luarocks.pack", package.seeall) 4module("luarocks.pack", package.seeall)
5 5
6local path = require("luarocks.path") 6local path = require("luarocks.path")
7local rep = require("luarocks.rep") 7local repos = require("luarocks.repos")
8local fetch = require("luarocks.fetch") 8local fetch = require("luarocks.fetch")
9local fs = require("luarocks.fs") 9local fs = require("luarocks.fs")
10local cfg = require("luarocks.cfg") 10local cfg = require("luarocks.cfg")
@@ -137,7 +137,7 @@ local function do_pack_binary_rock(name, version)
137 end 137 end
138 138
139 fs.change_dir(temp_dir) 139 fs.change_dir(temp_dir)
140 if not is_binary and not rep.has_binaries(name, version) then 140 if not is_binary and not repos.has_binaries(name, version) then
141 rock_file = rock_file:gsub("%."..cfg.arch:gsub("%-","%%-").."%.", ".all.") 141 rock_file = rock_file:gsub("%."..cfg.arch:gsub("%-","%%-").."%.", ".all.")
142 end 142 end
143 fs.delete(rock_file) 143 fs.delete(rock_file)
diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua
index b22d1ab6..a9d97540 100644
--- a/src/luarocks/remove.lua
+++ b/src/luarocks/remove.lua
@@ -6,7 +6,7 @@ module("luarocks.remove", package.seeall)
6local search = require("luarocks.search") 6local search = require("luarocks.search")
7local deps = require("luarocks.deps") 7local deps = require("luarocks.deps")
8local fetch = require("luarocks.fetch") 8local fetch = require("luarocks.fetch")
9local rep = require("luarocks.rep") 9local repos = require("luarocks.repos")
10local path = require("luarocks.path") 10local path = require("luarocks.path")
11local util = require("luarocks.util") 11local util = require("luarocks.util")
12local cfg = require("luarocks.cfg") 12local cfg = require("luarocks.cfg")
@@ -62,7 +62,7 @@ local function delete_versions(name, versions)
62 62
63 for version, _ in pairs(versions) do 63 for version, _ in pairs(versions) do
64 util.printout("Removing "..name.." "..version.."...") 64 util.printout("Removing "..name.." "..version.."...")
65 local ok, err = rep.delete_version(name, version) 65 local ok, err = repos.delete_version(name, version)
66 if not ok then return nil, err end 66 if not ok then return nil, err end
67 end 67 end
68 68
diff --git a/src/luarocks/rep.lua b/src/luarocks/repos.lua
index 5bb5fed5..e6f0c5f7 100644
--- a/src/luarocks/rep.lua
+++ b/src/luarocks/repos.lua
@@ -1,6 +1,6 @@
1 1
2--- Functions for managing the repository on disk. 2--- Functions for managing the repository on disk.
3module("luarocks.rep", package.seeall) 3module("luarocks.repos", package.seeall)
4 4
5local fs = require("luarocks.fs") 5local fs = require("luarocks.fs")
6local path = require("luarocks.path") 6local path = require("luarocks.path")
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua
index 9c53632a..4e0318c7 100644
--- a/src/luarocks/search.lua
+++ b/src/luarocks/search.lua
@@ -297,9 +297,9 @@ function print_results(results, show_repo, long)
297 297
298 for package, versions in util.sortedpairs(results) do 298 for package, versions in util.sortedpairs(results) do
299 util.printout(package) 299 util.printout(package)
300 for version, repos in util.sortedpairs(versions, deps.compare_versions) do 300 for version, repositories in util.sortedpairs(versions, deps.compare_versions) do
301 if show_repo then 301 if show_repo then
302 for _, repo in ipairs(repos) do 302 for _, repo in ipairs(repositories) do
303 util.printout(" "..version.." ("..repo.arch..") - "..repo.repo) 303 util.printout(" "..version.." ("..repo.arch..") - "..repo.repo)
304 end 304 end
305 else 305 else
@@ -319,8 +319,8 @@ end
319local function split_source_and_binary_results(results) 319local function split_source_and_binary_results(results)
320 local sources, binaries = {}, {} 320 local sources, binaries = {}, {}
321 for name, versions in pairs(results) do 321 for name, versions in pairs(results) do
322 for version, repos in pairs(versions) do 322 for version, repositories in pairs(versions) do
323 for _, repo in ipairs(repos) do 323 for _, repo in ipairs(repositories) do
324 local where = sources 324 local where = sources
325 if repo.arch == "all" or repo.arch == cfg.arch then 325 if repo.arch == "all" or repo.arch == cfg.arch then
326 where = binaries 326 where = binaries
diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua
index 7255ea63..5a052b58 100644
--- a/src/luarocks/show.lua
+++ b/src/luarocks/show.lua
@@ -82,9 +82,9 @@ function run(...)
82 local package, versions = util.sortedpairs(results)() 82 local package, versions = util.sortedpairs(results)()
83 --question: what do we do about multiple versions? This should 83 --question: what do we do about multiple versions? This should
84 --give us the latest version on the last repo (which is usually the global one) 84 --give us the latest version on the last repo (which is usually the global one)
85 for vs, repos in util.sortedpairs(versions, deps.compare_versions) do 85 for vs, repositories in util.sortedpairs(versions, deps.compare_versions) do
86 if not version then version = vs end 86 if not version then version = vs end
87 for _, rp in ipairs(repos) do repo_url = rp.repo end 87 for _, rp in ipairs(repositories) do repo_url = rp.repo end
88 end 88 end
89 89
90 90