Repository: conan-io/conan
Pull request #17382 (2024-11-26 18:21:46)

chock check fix
Changelog: Bugfix: Solve ``Choco().check()`` bug using legacy ``choco search --local-only``, replaced by ``choco list``.
Docs: Omit

Close https://github.com/conan-io/conan/issues/17381



Patch:
diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py
index 98a5dda3e..aebd9f855 100644
--- a/conan/tools/system/package_manager.py
+++ b/conan/tools/system/package_manager.py
@@ -320,8 +320,7 @@ class Chocolatey(_SystemPackageManagerTool):
     tool_name = "choco"
     install_command = "{tool} install --yes {packages}"
     update_command = "{tool} outdated"
-    check_command = '{tool} search --local-only --exact {package} | ' \
-                    'findstr /c:"1 packages installed."'
+    check_command = '{tool} list --exact {package} | findstr /c:"1 packages installed."'
 
 
 class PacMan(_SystemPackageManagerTool):
diff --git a/conans/model/conf.py b/conans/model/conf.py
index ebc41bc58..9140be00a 100644
--- a/conans/model/conf.py
+++ b/conans/model/conf.py
@@ -120,7 +120,7 @@ BUILT_IN_CONFS = {
     "tools.apple:enable_bitcode": "(boolean) Enable/Disable Bitcode Apple Clang flags",
     "tools.apple:enable_arc": "(boolean) Enable/Disable ARC Apple Clang flags",
     "tools.apple:enable_visibility": "(boolean) Enable/Disable Visibility Apple Clang flags",
-    "tools.env.virtualenv:powershell": "If it is set to True it will generate powershell launchers if os=Windows",
+    "tools.env.virtualenv:powershell": "If it is set to True it will generate powershell launchers",
     # Compilers/Flags configurations
     "tools.build:compiler_executables": "Defines a Python dict-like with the compilers path to be used. Allowed keys {'c', 'cpp', 'cuda', 'objc', 'objcxx', 'rc', 'fortran', 'asm', 'hip', 'ispc'}",
     "tools.build:cxxflags": "List of extra CXX flags used by different toolchains like CMakeToolchain, AutotoolsToolchain and MesonToolchain",


Test patch:
diff --git a/conan/test/utils/artifactory.py b/conan/test/utils/artifactory.py
index 11e62ca0a..c05aa2081 100644
--- a/conan/test/utils/artifactory.py
+++ b/conan/test/utils/artifactory.py
@@ -25,7 +25,7 @@ class _ArtifactoryServerStore(object):
 
     @staticmethod
     def _root_recipe(ref):
-        return "{}/{}/{}/{}".format(ref.user, ref.name, ref.version, ref.channel)
+        return "{}/{}/{}/{}".format(ref.user or "_", ref.name, ref.version, ref.channel or "_")
 
     @staticmethod
     def _ref_index(ref):
diff --git a/test/integration/tools/system/package_manager_test.py b/test/integration/tools/system/package_manager_test.py
index 5eb052bac..25bcb90f0 100644
--- a/test/integration/tools/system/package_manager_test.py
+++ b/test/integration/tools/system/package_manager_test.py
@@ -323,7 +323,7 @@ def test_tools_install_archless(tool_class, result):
     (Brew, 'test -n "$(brew ls --versions package)"'),
     (Pkg, 'pkg info package'),
     (PkgUtil, 'test -n "`pkgutil --list package`"'),
-    (Chocolatey, 'choco search --local-only --exact package | findstr /c:"1 packages installed."'),
+    (Chocolatey, 'choco list --exact package | findstr /c:"1 packages installed."'),
     (PacMan, 'pacman -Qi package'),
     (Zypper, 'rpm -q package'),
 ])