From d88460f61e84b41ee04a0cb2549d9c3b97d1139f Mon Sep 17 00:00:00 2001 From: RMZeroFour Date: Sun, 29 Oct 2023 18:00:28 +0530 Subject: [PATCH 1/3] package_manager: handle linux mint --- conan/tools/system/package_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py index 5a40478e6a9..e9a21f02726 100644 --- a/conan/tools/system/package_manager.py +++ b/conan/tools/system/package_manager.py @@ -39,7 +39,7 @@ def get_default_tool(self): os_name = distro.id() or os_name elif os_name == "Windows" and self._conanfile.conf.get("tools.microsoft.bash:subsystem") == "msys2": os_name = "msys2" - manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian"], + manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint"], "apk": ["alpine"], "yum": ["pidora", "scientific", "xenserver", "amazon", "oracle", "amzn", "almalinux", "rocky"], From d7b11329c1dd338e2572623cec2988563004f592 Mon Sep 17 00:00:00 2001 From: RMZeroFour Date: Sun, 29 Oct 2023 18:30:30 +0530 Subject: [PATCH 2/3] tests: verify apt-get for linux mint --- conans/test/integration/tools/system/package_manager_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conans/test/integration/tools/system/package_manager_test.py b/conans/test/integration/tools/system/package_manager_test.py index 669d2592757..de65d8f447c 100644 --- a/conans/test/integration/tools/system/package_manager_test.py +++ b/conans/test/integration/tools/system/package_manager_test.py @@ -45,6 +45,7 @@ def test_msys2(): @pytest.mark.parametrize("distro, tool", [ ("ubuntu", "apt-get"), ("debian", "apt-get"), + ("linuxmint", "apt-get"), ("pidora", "yum"), ("rocky", "yum"), ("fedora", "dnf"), From d8096bebdcc234e364fd369b0e22029cf741c25f Mon Sep 17 00:00:00 2001 From: RMZeroFour Date: Sun, 29 Oct 2023 18:46:41 +0530 Subject: [PATCH 3/3] package_manager: notify when not found --- conan/tools/system/package_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py index e9a21f02726..6b8cb887715 100644 --- a/conan/tools/system/package_manager.py +++ b/conan/tools/system/package_manager.py @@ -61,6 +61,11 @@ def get_default_tool(self): for d in distros: if d in os_name: return tool + + # No default package manager was found for the system, + # so notify the user + self._conanfile.output.info("A default system package manager couldn't be found for {}, " + "system packages will not be installed.".format(os_name)) def get_package_name(self, package, host_package=True): # Only if the package is for building, for example a library,