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.

uilianries added 2 commits Jun 11, 2019
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@jgsogo
Copy link
Member

@jgsogo jgsogo commented Jun 12, 2019

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

Loading

@uilianries
Copy link
Member Author

@uilianries uilianries commented Jun 12, 2019

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

Loading

@uilianries
Copy link
Member Author

@uilianries uilianries commented Jun 12, 2019

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.

Loading

@jgsogo
Copy link
Member

@jgsogo 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
...

Loading

@uilianries
Copy link
Member Author

@uilianries uilianries commented Jun 12, 2019

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

Loading

uilianries added 2 commits Jun 12, 2019
- 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
Member

@jgsogo jgsogo left a comment

Check the suggestion for the if/else block

Loading

conans/client/remover.py Outdated Show resolved Hide resolved
Loading
Signed-off-by: Uilian Ries <uilianries@gmail.com>
jgsogo
jgsogo approved these changes Jun 13, 2019
conans/client/remover.py Show resolved Hide resolved
Loading
@lasote lasote added this to the 1.17 milestone Jun 17, 2019
@danimtb danimtb merged commit cad452a into conan-io:develop Jun 17, 2019
2 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants