diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd/make.lua | 3 | ||||
-rw-r--r-- | src/luarocks/repos.lua | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index d3d02814..bfdddb37 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua | |||
@@ -31,6 +31,9 @@ This command is useful as a tool for debugging rockspecs. | |||
31 | To install rocks, you'll normally want to use the "install" and | 31 | To install rocks, you'll normally want to use the "install" and |
32 | "build" commands. See the help on those for details. | 32 | "build" commands. See the help on those for details. |
33 | 33 | ||
34 | NB: Use `luarocks install` with the `--only-deps` flag if you want to install | ||
35 | only dependencies of the rockspec (see `luarocks help install`). | ||
36 | |||
34 | --pack-binary-rock Do not install rock. Instead, produce a .rock file | 37 | --pack-binary-rock Do not install rock. Instead, produce a .rock file |
35 | with the contents of compilation in the current | 38 | with the contents of compilation in the current |
36 | directory. | 39 | directory. |
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 14c26313..1abb5628 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
@@ -446,4 +446,26 @@ function repos.which(name, version, item_type, item_name, repo) | |||
446 | return deploy_path | 446 | return deploy_path |
447 | end | 447 | end |
448 | 448 | ||
449 | --- Find full path to a file providing a module or a command | ||
450 | -- in a package. | ||
451 | -- @param name string: name of package. | ||
452 | -- @param version string: exact package version in string format. | ||
453 | -- @param item_type string: "module" or "command". | ||
454 | -- @param item_name string: module or command name. | ||
455 | -- @param root string or nil: A local root dir for a rocks tree. If not given, the default is used. | ||
456 | -- @return string: absolute path to the file providing given module | ||
457 | -- or command. | ||
458 | function repos.which(name, version, item_type, item_name, repo) | ||
459 | local deploy_type, file_path = manif.get_providing_file(name, version, item_type, item_name, repo) | ||
460 | local non_versioned, versioned = get_deploy_paths(name, version, deploy_type, file_path, repo) | ||
461 | local cur_name, cur_version = manif.get_current_provider(item_type, item_name) | ||
462 | local deploy_path = (name == cur_name and version == cur_version) and non_versioned or versioned | ||
463 | |||
464 | if deploy_type == "bin" and cfg.wrapper_suffix and cfg.wrapper_suffix ~= "" then | ||
465 | deploy_path = find_suffixed(deploy_path, cfg.wrapper_suffix) or deploy_path | ||
466 | end | ||
467 | |||
468 | return deploy_path | ||
469 | end | ||
470 | |||
449 | return repos | 471 | return repos |