Skip to content

Commit

Permalink
package_manager: handle linux mint (#15026)
Browse files Browse the repository at this point in the history
* package_manager: handle linux mint

* tests: verify apt-get for linux mint

* package_manager: notify when not found
  • Loading branch information
RMZeroFour authored Oct 29, 2023
1 parent da85f6f commit 84e5fae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conan/tools/system/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 84e5fae

Please sign in to comment.