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

Remove packages when version is asterisk #5346

Merged
merged 5 commits into from Jun 17, 2019

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Jun 12, 2019

When removing a pattern like hello/*@conan/testing, Conan doesn't remove all patterns because all fields (name, version, channel, user) are validated by ConanFileReference. However, when using a pattern like hello*/*@conan/testing, the ConanFileReference won't match the name and will search for recipes.

Changelog: Fix: Remove packages when version is asterisk (#5297)
Docs: Omit

fixes #5297

  • 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.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@jgsogo
Copy link
Contributor

jgsogo commented Jun 12, 2019

Wait, just * is valid as a version for a reference?

@uilianries
Copy link
Member Author

Version range is okay, it's validated by ConanFileReference. The only problem there is about when only version is *. Do you see another scenario?

@uilianries
Copy link
Member Author

Actually this error only occurs for remove command. You can run search using the same pattern like hello/*@conan/stable and it will work. That's why I only changed that rule in Remover and not in ConanFileReference where all pattern is validated.

@jgsogo
Copy link
Contributor

jgsogo commented Jun 12, 2019

(Forget my comment about the validation.)

This also fails for any pattern with a single * in any of the components of the reference:

conan remove hello/*@conan/stable
conan remove hello/*@*/stable
conan remove hello/version@*/stable
...

@uilianries
Copy link
Member Author

@jgsogo Oh, it's true, good catch! I'll update that! thanks

- Not only version, but also channel and user can
  contain asterisk

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

Check the suggestion for the if/else block

conans/client/remover.py Outdated Show resolved Hide resolved
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@lasote lasote added this to the 1.17 milestone Jun 17, 2019
@danimtb danimtb merged commit cad452a into conan-io:develop Jun 17, 2019
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] conan remove does not find recipe
4 participants