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

SystemPackageTool: fix mode=verify #10596

Merged
merged 1 commit into from Feb 16, 2022
Merged

SystemPackageTool: fix mode=verify #10596

merged 1 commit into from Feb 16, 2022

Conversation

ericLemanissier
Copy link
Contributor

@ericLemanissier ericLemanissier commented Feb 16, 2022

In this case, never install any package

fixes #10592

Changelog: Bugfix: Fix SystemPackageTool when mode=verify, it was still installing packages.
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

In this case, never install any package

fixes #10592
@@ -169,11 +170,12 @@ def install_packages(self, packages, update=True, force=False, arch_names=None):
% "\n".join(packages))
return

if mode == "verify" and not self._installed(packages):
if mode == "verify" and self._to_be_installed(packages):
Copy link
Member

Choose a reason for hiding this comment

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

This might not be ok, as in this context the packages is a list of alternate package names, not about different packages. So to_be_installed() will always return something if a list of names is provided.

I'd say with the return fix, it should be ok, can you please check? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really? I thought install_packages was made to install all the packages https://docs.conan.io/en/latest/reference/conanfile/methods.html#systempackagetool

Copy link
Member

Choose a reason for hiding this comment

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

Oh, ok, my bad, I was confused by the Github diff, didn't realize this was inside the install_packages.
You are right, this is ok.

@memsharded memsharded added this to the 1.46 milestone Feb 16, 2022
@@ -169,11 +170,12 @@ def install_packages(self, packages, update=True, force=False, arch_names=None):
% "\n".join(packages))
return

if mode == "verify" and not self._installed(packages):
if mode == "verify" and self._to_be_installed(packages):
Copy link
Member

Choose a reason for hiding this comment

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

Oh, ok, my bad, I was confused by the Github diff, didn't realize this was inside the install_packages.
You are right, this is ok.

@memsharded memsharded merged commit cb25aa8 into conan-io:develop Feb 16, 2022
@ericLemanissier ericLemanissier deleted the patch-1 branch February 16, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] SystemPackageTool installs packages when it should not
2 participants