aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/loader.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/luarocks/loader.lua b/src/luarocks/loader.lua
index 1eaa6721..ba15613e 100644
--- a/src/luarocks/loader.lua
+++ b/src/luarocks/loader.lua
@@ -6,8 +6,8 @@
6-- used to load previous modules, so that the loader chooses versions 6-- used to load previous modules, so that the loader chooses versions
7-- that are declared to be compatible with the ones loaded earlier. 7-- that are declared to be compatible with the ones loaded earlier.
8local loaders = package.loaders or package.searchers 8local loaders = package.loaders or package.searchers
9local package, require, ipairs, pairs, table, type, next, tostring, error = 9local package, require, ipairs, table, type, next, tostring, error =
10 package, require, ipairs, pairs, table, type, next, tostring, error 10 package, require, ipairs, table, type, next, tostring, error
11local unpack = unpack or table.unpack 11local unpack = unpack or table.unpack
12 12
13--module("luarocks.loader") 13--module("luarocks.loader")
@@ -20,6 +20,7 @@ cfg.init_package_paths()
20local path = require("luarocks.path") 20local path = require("luarocks.path")
21local manif_core = require("luarocks.manif_core") 21local manif_core = require("luarocks.manif_core")
22local deps = require("luarocks.deps") 22local deps = require("luarocks.deps")
23local util = require("luarocks.util")
23 24
24loader.context = {} 25loader.context = {}
25 26
@@ -79,7 +80,7 @@ function loader.add_context(name, version)
79 for _, tree in ipairs(loader.rocks_trees) do 80 for _, tree in ipairs(loader.rocks_trees) do
80 local entries = tree.manifest.repository[pkg] 81 local entries = tree.manifest.repository[pkg]
81 if entries then 82 if entries then
82 for version, pkgs in pairs(entries) do 83 for version, pkgs in util.sortedpairs(entries, deps.compare_versions) do
83 if (not constraints) or deps.match_constraints(deps.parse_version(version), constraints) then 84 if (not constraints) or deps.match_constraints(deps.parse_version(version), constraints) then
84 loader.add_context(pkg, version) 85 loader.add_context(pkg, version)
85 end 86 end