diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/cmd/show.lua | 30 | ||||
| -rw-r--r-- | src/luarocks/util.lua | 1 |
2 files changed, 22 insertions, 9 deletions
diff --git a/src/luarocks/cmd/show.lua b/src/luarocks/cmd/show.lua index bed210d2..dfd2f3de 100644 --- a/src/luarocks/cmd/show.lua +++ b/src/luarocks/cmd/show.lua | |||
| @@ -7,7 +7,6 @@ local search = require("luarocks.search") | |||
| 7 | local cfg = require("luarocks.core.cfg") | 7 | local cfg = require("luarocks.core.cfg") |
| 8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
| 9 | local path = require("luarocks.path") | 9 | local path = require("luarocks.path") |
| 10 | local vers = require("luarocks.core.vers") | ||
| 11 | local fetch = require("luarocks.fetch") | 10 | local fetch = require("luarocks.fetch") |
| 12 | local manif = require("luarocks.manif") | 11 | local manif = require("luarocks.manif") |
| 13 | local repos = require("luarocks.repos") | 12 | local repos = require("luarocks.repos") |
| @@ -19,13 +18,14 @@ show.help = [[ | |||
| 19 | Without any flags, show all module information. | 18 | Without any flags, show all module information. |
| 20 | With these flags, return only the desired information: | 19 | With these flags, return only the desired information: |
| 21 | 20 | ||
| 22 | --home home page of project | 21 | --home home page of project |
| 23 | --modules all modules provided by this package as used by require() | 22 | --modules all modules provided by this package as used by require() |
| 24 | --deps packages this package depends on | 23 | --deps packages this package depends on |
| 25 | --rockspec the full path of the rockspec file | 24 | --build-deps build-only dependencies for this package |
| 26 | --mversion the package version | 25 | --rockspec the full path of the rockspec file |
| 27 | --rock-tree local tree where rock is installed | 26 | --mversion the package version |
| 28 | --rock-dir data directory of the installed rock | 27 | --rock-tree local tree where rock is installed |
| 28 | --rock-dir data directory of the installed rock | ||
| 29 | ]] | 29 | ]] |
| 30 | 30 | ||
| 31 | local function keys_as_string(t, sep) | 31 | local function keys_as_string(t, sep) |
| @@ -112,6 +112,10 @@ function show.command(flags, name, version) | |||
| 112 | for _, dep in ipairs(rockspec.dependencies) do | 112 | for _, dep in ipairs(rockspec.dependencies) do |
| 113 | util.printout(tostring(dep)) | 113 | util.printout(tostring(dep)) |
| 114 | end | 114 | end |
| 115 | elseif flags["build-deps"] then | ||
| 116 | for _, dep in ipairs(rockspec.build_dependencies) do | ||
| 117 | util.printout(tostring(dep)) | ||
| 118 | end | ||
| 115 | elseif flags["rockspec"] then util.printout(rockspec_file) | 119 | elseif flags["rockspec"] then util.printout(rockspec_file) |
| 116 | elseif flags["mversion"] then util.printout(version) | 120 | elseif flags["mversion"] then util.printout(version) |
| 117 | else | 121 | else |
| @@ -148,6 +152,14 @@ function show.command(flags, name, version) | |||
| 148 | print_items(name, version, minfo.modules, "module", repo) | 152 | print_items(name, version, minfo.modules, "module", repo) |
| 149 | end | 153 | end |
| 150 | 154 | ||
| 155 | if #rockspec.build_dependencies > 0 then | ||
| 156 | util.printout() | ||
| 157 | util.printout("Has build dependency on:") | ||
| 158 | for _, dep in ipairs(rockspec.build_dependencies) do | ||
| 159 | util.printout("\t"..tostring(dep).." "..installed_rock_label(dep, flags["tree"])) | ||
| 160 | end | ||
| 161 | end | ||
| 162 | |||
| 151 | local direct_deps = {} | 163 | local direct_deps = {} |
| 152 | if #rockspec.dependencies > 0 then | 164 | if #rockspec.dependencies > 0 then |
| 153 | util.printout() | 165 | util.printout() |
| @@ -166,7 +178,7 @@ function show.command(flags, name, version) | |||
| 166 | has_indirect_deps = true | 178 | has_indirect_deps = true |
| 167 | end | 179 | end |
| 168 | 180 | ||
| 169 | util.printout("\t"..dep_name.." "..installed_rock_label(dep_name, flags["tree"])) | 181 | util.printout("\t"..tostring(dep_name).." "..installed_rock_label(queries.new(dep_name), flags["tree"])) |
| 170 | end | 182 | end |
| 171 | end | 183 | end |
| 172 | util.printout() | 184 | util.printout() |
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 426868e4..c797fa80 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua | |||
| @@ -86,6 +86,7 @@ local supported_flags = { | |||
| 86 | ["bin"] = true, | 86 | ["bin"] = true, |
| 87 | ["binary"] = true, | 87 | ["binary"] = true, |
| 88 | ["branch"] = "<branch-name>", | 88 | ["branch"] = "<branch-name>", |
| 89 | ["build-deps"] = true, | ||
| 89 | ["debug"] = true, | 90 | ["debug"] = true, |
| 90 | ["deps"] = true, | 91 | ["deps"] = true, |
| 91 | ["deps-mode"] = "<mode>", | 92 | ["deps-mode"] = "<mode>", |
