In #7526 a comparison for `paths` was introduced, but if `paths` is ever
`nil`, this triggers an error.
Coercing the variable to an Array should alleviate this problem, as
`nil.to_a` produces an empty and comparable Array.
Fixes#7540
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
We don't remove `etc` files on uninstall. Now we have `pkgetc`, though,
we have a pretty decent guess at what files in `etc` may belong to a
given package and can warn about them being left around on uninstall.
Thoughts: should we do the same thing for `var`? I don't see it being
used nearly as consistently.
If `Homebrew.args` hasn't yet been populated then `named` will return
`nil`. Instead, ensure it is an array before we try to `join` it.
This is pretty much only a test-time problem but has been causing flaky
builds.
Previously, this only included a subset of all the kegs the user was
trying to uninstall. With this change, all named formulae/kegs will be
included in the example command.
Works around Rubycop not liking method names that start with `is_`
by changing convention from singular to plural.
I think it's better that way anyway.
Suggested in #1084.
Made the existing warning output entirely to STDERR, because
previously the first line went to STDERR and subsequent ones went
to STDOUT.
With the way uninstall is set up at the moment, it's pretty difficult to
add functionality to both the --force and normal variants.
Extracting the racks and kegs to be uninstalled before uninstalling them
should make this easier.
When exactly two versions of a package were installed, the uninstall
message should not read "Remove them all with...", since only one
version remains.
"Remove all versions with..." is flexible enough to avoid being
interpreted as grammatically incorrect, and it still accurately
describes the general behavior of `brew uninstall --force`.