From 737959ac2cb795665ccae272997cd0c85d9d5199 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 13 Mar 2026 22:52:05 +0800 Subject: improve vcpkg check --- xmake/modules/package/manager/vcpkg/install_package.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index 7c4141861..2c2c520f3 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -62,13 +62,15 @@ function _install_for_classic(vcpkg, name, opt) -- @see https://github.com/xmake-io/xmake/issues/7388 local basename = name:gsub("%[.-%]", "") if basename ~= name then - if vcpkg_utils.is_installed(vcpkg, basename, triplet) then - local confirm = utils.confirm({default = true, - description = format("%s:%s is already installed with other features, installing %s will rebuild it and its dependencies, continue?", basename, triplet, name)}) - if confirm then - table.insert(argv, "--recurse") - else - raise("install %s:%s cancelled!", name, triplet) + if not vcpkg_utils.is_installed(vcpkg, name, triplet) then + if vcpkg_utils.is_installed(vcpkg, basename, triplet) then + local confirm = utils.confirm({default = true, + description = format("%s:%s is already installed (possibly with different features). Installing %s will require a rebuild of it and its dependencies. Continue?", basename, triplet, name)}) + if confirm then + table.insert(argv, "--recurse") + else + raise("install %s:%s cancelled!", name, triplet) + end end end end -- cgit v1.3.1