summaryrefslogtreecommitdiff
path: root/xmake/actions/require/impl/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-02-01 22:40:41 +0800
committerruki <[email protected]>2019-02-01 10:04:10 +0800
commitc7d912fd9499928e8e6a21783c9d76076f1dd276 (patch)
tree56121dca85c641cbf9ec2bba304aeef44867cd4a /xmake/actions/require/impl/package.lua
parent3d8fd90a3cab27e4ba17ba6d263da11a869c3b5b (diff)
improve package confirm tips
Diffstat (limited to 'xmake/actions/require/impl/package.lua')
-rw-r--r--xmake/actions/require/impl/package.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index d362563a4..159497b60 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -340,11 +340,25 @@ function _get_confirm(packages)
-- get confirm
local confirm = option.get("yes")
if confirm == nil then
-
+
+ -- get packages for each repositories
+ local packages_repo = {}
+ for _, package in ipairs(packages) do
+ local reponame = package:repo() and package:repo():name() or package:fromkind()
+ if package:is3rd() then
+ reponame = package:name():lower():split("::")[1]
+ end
+ packages_repo[reponame] = packages_repo[reponame] or {}
+ table.insert(packages_repo[reponame], package)
+ end
+
-- show tips
cprint("${bright color.warning}note: ${clear}try installing these packages (pass -y to skip confirm)?")
- for _, package in ipairs(packages) do
- print(" -> %s %s %s", package:name(), package:version_str() or "", package:debug() and "(debug)" or "")
+ for reponame, packages in pairs(packages_repo) do
+ print("in %s:", reponame)
+ for _, package in ipairs(packages) do
+ print(" -> %s %s %s", package:name(), package:version_str() or "", package:debug() and "(debug)" or "")
+ end
end
cprint("please input: y (y/n)")