Added a setting for the remove command --x-re=pattern #20014
workpadwan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have some code changes to vcpkg-tool which I have tested on a windows and a WSL2 machine.
It works as follows:
vcpkg remove --x-re=regex_pattern
or
vcpkg remove "--x-re=regex_pattern"
if you have certain constructs in the regex
I needed this feature in a use case where I share a vcpkg folder with a couple of libraries we develop. This way I can provide a regex to express the packages I want to remove between the installations / exports.
It basically works this way:
When --x-re is provided and the list of packages to be removed is empty, it will list all installed packages and add any package that matches the regex (I also match that the listed package is the same as default_triplet).
When --x-re is provided and the list of packages to be removed is a provided list, it will try to match the regex to the provided list and displays a warning.
Currently I limited the matching so it will not be applied when the --outdated option is provided, an error message will be displayed in this case.
Question 1: Should I check the triplet or not?
Question 2: Should the use-case with provided packages be used?
Meaning i.e.
vcpkg remove "--x-re=(boost).*" boost grpc
This will result that the single token "boost" will be passed to the rest of the removal process even if grpc has been manually provided. (a warning is printed though)
Question 3: I assume that the --outdated flag should not be used with --x-re=pattern, right?
If I'm wrong please explain how it should work...
If this is of any interest I can provided the code changes in remove.cpp (note that I cannot add cpp files here, so I renamed it to remove.log
remove.log
).
Beta Was this translation helpful? Give feedback.
All reactions