diff options
Diffstat (limited to 'src/luarocks/deps.lua')
-rw-r--r-- | src/luarocks/deps.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 27062cbb..a669ad66 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -317,7 +317,7 @@ local function match_dep(dep, blacklist) | |||
317 | 317 | ||
318 | local versions | 318 | local versions |
319 | if dep.name == "lua" then | 319 | if dep.name == "lua" then |
320 | versions = { "5.1" } | 320 | versions = { cfg.lua_version } |
321 | else | 321 | else |
322 | versions = manif_core.get_versions(dep.name) | 322 | versions = manif_core.get_versions(dep.name) |
323 | end | 323 | end |
@@ -470,7 +470,7 @@ function fulfill_dependencies(rockspec) | |||
470 | if not match_dep(dep) then | 470 | if not match_dep(dep) then |
471 | local rock = search.find_suitable_rock(dep) | 471 | local rock = search.find_suitable_rock(dep) |
472 | if not rock then | 472 | if not rock then |
473 | return nil, "Could not find a rock to satisfy dependency: "..show_dep(dep) | 473 | return nil, "Could not satisfy dependency: "..show_dep(dep) |
474 | end | 474 | end |
475 | local ok, err, errcode = install.run(rock) | 475 | local ok, err, errcode = install.run(rock) |
476 | if not ok then | 476 | if not ok then |
@@ -568,7 +568,7 @@ function check_external_deps(rockspec, mode) | |||
568 | end | 568 | end |
569 | end | 569 | end |
570 | else | 570 | else |
571 | found = fs.exists(dir.path(dirdata.dir, f)) | 571 | found = fs.is_file(dir.path(dirdata.dir, f)) |
572 | end | 572 | end |
573 | if found then | 573 | if found then |
574 | break | 574 | break |
@@ -606,12 +606,15 @@ end | |||
606 | --- Recursively scan dependencies, to build a transitive closure of all | 606 | --- Recursively scan dependencies, to build a transitive closure of all |
607 | -- dependent packages. | 607 | -- dependent packages. |
608 | -- @param results table: The results table being built. | 608 | -- @param results table: The results table being built. |
609 | -- @param missing table: The table of missing dependencies being recursively built. | ||
610 | -- @param manifest table: The manifest table containing dependencies. | ||
609 | -- @param name string: Package name. | 611 | -- @param name string: Package name. |
610 | -- @param version string: Package version. | 612 | -- @param version string: Package version. |
611 | -- @return (table, table): The results and a table of missing dependencies. | 613 | -- @return (table, table): The results and a table of missing dependencies. |
612 | function scan_deps(results, missing, manifest, name, version) | 614 | function scan_deps(results, missing, manifest, name, version) |
613 | assert(type(results) == "table") | 615 | assert(type(results) == "table") |
614 | assert(type(missing) == "table") | 616 | assert(type(missing) == "table") |
617 | assert(type(manifest) == "table") | ||
615 | assert(type(name) == "string") | 618 | assert(type(name) == "string") |
616 | assert(type(version) == "string") | 619 | assert(type(version) == "string") |
617 | 620 | ||
@@ -630,7 +633,7 @@ function scan_deps(results, missing, manifest, name, version) | |||
630 | if not deplist then | 633 | if not deplist then |
631 | rockspec, err = fetch.load_local_rockspec(path.rockspec_file(name, version)) | 634 | rockspec, err = fetch.load_local_rockspec(path.rockspec_file(name, version)) |
632 | if err then | 635 | if err then |
633 | missing[name.." "..version] = true | 636 | missing[name.." "..version] = err |
634 | return results, missing | 637 | return results, missing |
635 | end | 638 | end |
636 | dependencies_name[version] = rockspec.dependencies | 639 | dependencies_name[version] = rockspec.dependencies |
@@ -643,7 +646,7 @@ function scan_deps(results, missing, manifest, name, version) | |||
643 | end | 646 | end |
644 | if next(failures) then | 647 | if next(failures) then |
645 | for _, failure in pairs(failures) do | 648 | for _, failure in pairs(failures) do |
646 | missing[show_dep(failure)] = true | 649 | missing[show_dep(failure)] = "failed" |
647 | end | 650 | end |
648 | end | 651 | end |
649 | results[name] = version | 652 | results[name] = version |