summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-11 00:50:23 +0800
committerruki <[email protected]>2022-02-11 00:50:23 +0800
commit71d3072d61778f930419d741fea8009fdca3efb1 (patch)
treef8c0224185f9946ca7cd17c9635e1dda58a771af
parente93ce24968986daca4186ec7eb96a4a4076043c4 (diff)
improve to find system package
-rw-r--r--xmake/modules/private/action/require/impl/install_packages.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua
index f62a0fb52..e2b2ebf7b 100644
--- a/xmake/modules/private/action/require/impl/install_packages.lua
+++ b/xmake/modules/private/action/require/impl/install_packages.lua
@@ -562,6 +562,7 @@ function main(requires, opt)
local packages_install = {}
local packages_download = {}
local packages_unsupported = {}
+ local packages_not_found = {}
for _, instance in ipairs(packages) do
if package.should_install(instance) then
if instance:is_supported() then
@@ -572,12 +573,17 @@ function main(requires, opt)
elseif not instance:is_optional() then
table.insert(packages_unsupported, instance)
end
+ -- @see https://github.com/xmake-io/xmake/issues/2050
+ elseif not instance:exists() and not instance:is_optional() then
+ local requireinfo = instance:requireinfo()
+ if requireinfo and requireinfo.system then
+ table.insert(packages_not_found, instance)
+ end
end
end
-- exists unsupported packages?
if #packages_unsupported > 0 then
- -- show tips
cprint("${bright color.warning}note: ${clear}the following packages are unsupported for $(plat)/$(arch)!")
for _, instance in ipairs(packages_unsupported) do
print(" -> %s %s", instance:displayname(), instance:version_str() or "")
@@ -585,6 +591,15 @@ function main(requires, opt)
raise()
end
+ -- exists not found packages?
+ if #packages_not_found > 0 then
+ cprint("${bright color.warning}note: ${clear}the following packages are not found for $(plat)/$(arch)!")
+ for _, instance in ipairs(packages_not_found) do
+ print(" -> %s %s", instance:displayname(), instance:version_str() or "")
+ end
+ raise()
+ end
+
-- get user confirm
local confirm, packages_modified = _get_confirm(packages_install)
if not confirm then