Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package_manager: fix opensuse detection #11660

Merged
merged 7 commits into from Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion conan/tools/system/package_manager.py
Expand Up @@ -37,7 +37,7 @@ def get_default_tool(self):
"brew": ["Darwin"],
"pacman": ["arch", "manjaro", "msys2"],
"choco": ["Windows"],
"zypper": ["opensuse", "sles"],
"zypper": ["opensuse", "sles", "opensuse-tumbleweed"],
Copy link
Contributor

@czoido czoido Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding "opensuse-tumbleweed" as the distro related to zypper should solve the issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3368 mentions opensuse-leap, and I have no idea what are the names for sles. This is why I chose to keep the behaviour of conans/client/tools/oss.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see, we can do some mix of both, and also test opensuse-leap and make sure that in the future if one distro returns opensuse-newversion it will not break...

"pkg": ["freebsd"],
"pkgutil": ["Solaris"]}
for tool, distros in manager_mapping.items():
Expand Down
3 changes: 2 additions & 1 deletion conans/test/integration/tools/system/package_manager_test.py
Expand Up @@ -51,9 +51,10 @@ def test_msys2():
("fedora", "dnf"),
("arch", "pacman"),
("opensuse", "zypper"),
("sles", "zypper"),
("opensuse-tumbleweed", "zypper"),
("freebsd", "pkg"),
])
@pytest.mark.skipif(platform.system() != "Linux", reason="Only linux")
def test_package_manager_distro(distro, tool):
with mock.patch("platform.system", return_value="Linux"):
with mock.patch("distro.id", return_value=distro):
Expand Down