diff options
author | Hisham <hisham@gobolinux.org> | 2016-10-31 02:59:35 -0200 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-10-31 02:59:35 -0200 |
commit | ca574535f2135da88b10946577e43d711b868cc8 (patch) | |
tree | 32d8737f61abdb7f960d83ffa7071baf07fd9a4f /src | |
parent | 7090601b6b7288f0194b58f9d0e168392c8e6690 (diff) | |
download | luarocks-ca574535f2135da88b10946577e43d711b868cc8.tar.gz luarocks-ca574535f2135da88b10946577e43d711b868cc8.tar.bz2 luarocks-ca574535f2135da88b10946577e43d711b868cc8.zip |
Fix merge of rocks_provided.
This is now a parameter, because depending on the rockspec version the set of
default rocks_provided for a rockspec may change. This is to maintain
compatibility with rocks provided by LuaRocks versions in rockspec format 1.0.
When checking dependencies for a rockspec, we ensure we respect that to keep
backward compatibility. When we check dependencies for the manifest as a
whole, we can use the larger set of rocks_provided known by the current
LuaRocks version.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/deps.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 9c737d66..1c75a694 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -147,7 +147,7 @@ end | |||
147 | -- @param dep table: A dependency parsed in table format. | 147 | -- @param dep table: A dependency parsed in table format. |
148 | -- @param blacklist table: Versions that can't be accepted. Table where keys | 148 | -- @param blacklist table: Versions that can't be accepted. Table where keys |
149 | -- are program versions and values are 'true'. | 149 | -- are program versions and values are 'true'. |
150 | -- @param provided table: A table of auto-dependencies provided | 150 | -- @param rocks_provided table: A table of auto-dependencies provided |
151 | -- by this Lua implementation for the given dependency. | 151 | -- by this Lua implementation for the given dependency. |
152 | -- @return string or nil: latest installed version of the rock matching the dependency | 152 | -- @return string or nil: latest installed version of the rock matching the dependency |
153 | -- or nil if it could not be matched. | 153 | -- or nil if it could not be matched. |
@@ -235,19 +235,21 @@ end | |||
235 | -- @param version string: package version. | 235 | -- @param version string: package version. |
236 | -- @param dependencies table: array of dependencies. | 236 | -- @param dependencies table: array of dependencies. |
237 | -- @param deps_mode string: Which trees to check dependencies for: | 237 | -- @param deps_mode string: Which trees to check dependencies for: |
238 | -- @param rocks_provided table: A table of auto-dependencies provided | ||
239 | -- by this Lua implementation for the given dependency. | ||
238 | -- "one" for the current default tree, "all" for all trees, | 240 | -- "one" for the current default tree, "all" for all trees, |
239 | -- "order" for all trees with priority >= the current default, "none" for no trees. | 241 | -- "order" for all trees with priority >= the current default, "none" for no trees. |
240 | function deps.report_missing_dependencies(name, version, dependencies, deps_mode) | 242 | function deps.report_missing_dependencies(name, version, dependencies, deps_mode, rocks_provided) |
241 | local first_missing_dep = true | 243 | local first_missing_dep = true |
242 | 244 | ||
243 | for _, dep in ipairs(dependencies) do | 245 | for _, dep in ipairs(dependencies) do |
244 | if not match_dep(dep, nil, deps_mode) then | 246 | if not match_dep(dep, nil, deps_mode, rocks_provided) then |
245 | if first_missing_dep then | 247 | if first_missing_dep then |
246 | util.printout(("Missing dependencies for %s %s:"):format(name, version)) | 248 | util.printout(("Missing dependencies for %s %s:"):format(name, version)) |
247 | first_missing_dep = false | 249 | first_missing_dep = false |
248 | end | 250 | end |
249 | 251 | ||
250 | util.printout((" %s (%s)"):format(deps.show_dep(dep), rock_status(dep.name, deps_mode))) | 252 | util.printout((" %s (%s)"):format(deps.show_dep(dep), rock_status(dep.name, deps_mode, rocks_provided))) |
251 | end | 253 | end |
252 | end | 254 | end |
253 | end | 255 | end |
@@ -292,7 +294,7 @@ function deps.fulfill_dependencies(rockspec, deps_mode) | |||
292 | end | 294 | end |
293 | end | 295 | end |
294 | 296 | ||
295 | deps.report_missing_dependencies(rockspec.name, rockspec.version, rockspec.dependencies, deps_mode) | 297 | deps.report_missing_dependencies(rockspec.name, rockspec.version, rockspec.dependencies, deps_mode, rockspec.rocks_provided) |
296 | 298 | ||
297 | local first_missing_dep = true | 299 | local first_missing_dep = true |
298 | 300 | ||