summaryrefslogtreecommitdiff
path: root/xmake/actions/require/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-12 22:50:39 +0800
committerruki <[email protected]>2018-09-12 11:03:55 +0800
commit0a8a275f8cb9a51446746f796031882dfc8381ae (patch)
tree4aa0f38d8fcf31804f16e313a144ba430e88e302 /xmake/actions/require/package.lua
parent6638fb5f62e95b465305914953e38233d49a8856 (diff)
check unsupported packages
Diffstat (limited to 'xmake/actions/require/package.lua')
-rw-r--r--xmake/actions/require/package.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/xmake/actions/require/package.lua b/xmake/actions/require/package.lua
index be82e9460..b95b7bcc4 100644
--- a/xmake/actions/require/package.lua
+++ b/xmake/actions/require/package.lua
@@ -340,13 +340,30 @@ end
-- get user confirm
function _get_confirm(packages)
- -- init confirmed packages
+ -- init confirmed and not supported packages
local confirmed_packages = {}
+ local not_supported_packages = {}
for _, package in ipairs(packages) do
if (option.get("force") or not package:exists()) and (#package:urls() > 0 or package:script("install")) then
- table.insert(confirmed_packages, package)
+ if package:supported() then
+ table.insert(confirmed_packages, package)
+ else
+ table.insert(not_supported_packages, package)
+ end
+ end
+ end
+
+ -- exists not supported packages?
+ if #not_supported_packages > 0 then
+ -- show tips
+ cprint("${bright red}note: ${default red}the following packages are unsupported for $(plat)/$(arch)!")
+ for _, package in ipairs(not_supported_packages) do
+ print(" -> %s %s", package:name(), package:version_str() or "")
end
+ raise()
end
+
+ -- no confirmed packages?
if #confirmed_packages == 0 then
return true
end