microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.23k stars 6.4k forks source link

Removing packages using a pattern or regular expression #8486

Closed sryze closed 3 years ago

sryze commented 5 years ago

It would be nice if it was possible to remove a bunch of packages using a regexp without typing all their names, similar to how apt-get does it. For example, if I install Boost and I want to remove all the Boost libraries there is no way to simply do vcpkg remove boost*, I have to remove every package one by one.

Proposed solution

Make remove accept a regular expression as a package name.

Describe alternatives you've considered

Alternative - delete the files by hand from vcpkg/installed/.

MVoz commented 5 years ago

vcpkg remove boost[*] ?

vicroms commented 5 years ago

Hi @sryze,

I'll bring your feature suggestion to the team for discussion, however, I cannot promise that it will be implemented any time soon. But, we would gladly take a PR that implements such a feature!

For boost specifically, I suggest doing vcpkg remove boost-vcpkg-helpers --recurse 😅

SunnyWar commented 4 years ago

I encountered this problem this morning...very, very annoying.

"vcpkg.exe install boost" "vcpkg.exe remove boost"

dozens of packages left installed. It seems like a bug.

vicroms commented 4 years ago

Some packages like boost, and qt5 are "meta-packages". This means that these packages themselves are empty, and what they do is depend on other packages to install them all together as a convenience.

As all boost libraries depend on boost-vcpkg-helpers, you should be able to remove them with vcpkg remove boost-vcpkg-helpers --recurse

SunnyWar commented 4 years ago

Thanks @vicroms, that helped. Though there is still stuff left behind: boost-build:x86-windows 1.72.0 Boost.Build boost-modular-build-helper:x86-windows 1.72.0 bzip2:x86-windows 1.0.6-4 High-quality data compressor. libffi:x86-windows 3.1-7 Portable, high level programming interface to va... liblzma:x86-windows 5.2.4-3 Compression library with an API similar to that ... openssl-windows:x86-windows 1.1.1d-1 OpenSSL is an open source project that provides ... openssl:x86-windows 1.1.1d OpenSSL is an open source project that provides ... python3:x86-windows 3.7.3 The Python programming language as an embeddable... zlib:x86-windows 1.2.11-5 A compression library zstd:x86-windows 1.4.0-1 Zstandard - Fast real-time compression algorithm

jafrado commented 4 years ago

Any progress on this issue?

PhoebeHui commented 3 years ago

Currently, you can simply remove all boost components via './vcpkg remove boost-uninstall --recurse', see more discussions in PR #12851.

pravic commented 3 years ago

How about other packages?

PhoebeHui commented 3 years ago

Currently it only works for boost, I reopen this issue for tracking the features request.