This can be useful when testing fetch on a different processor than the
one the user is running on.
While we're here, refactor code run on `source` to need a function call
instead.
If an installed cask is invalid on attempting an untap: it will
prevent untapping that cask.
Fix this in two ways: one more specific to `untap` and one more
generally to other commands too:
- specific: only read the actual formulae/casks from the tap we're
untapping instead of all of those that are installed
- general: rescue more exceptions in `Cask::Caskroom.casks` (like we
already do for `Formula.installed`
The idea here is that it should be expected that `brew upgrade` will
not upgrade pinned packages but will attempt to upgrade everything else.
For that reason, it will only show a warning about pinned packages
in that case.
If, on the other hand, you pass the name of a pinned package explicitly
to the upgrade command, like in `brew upgrade PINNED`, we want to show
an error since we cannot upgrade that package until it gets unpinned.
The hope is that this will be clearer and less annoying for users.
A user came to us a couple weeks ago stating that it was confusing
that the `brew upgrade` command printed an error when a pinned
formula had a new version available and didn't get upgraded.
This PR changes that message to a warning from an error. While looking
into this we found that there is another message that gets printed
when a package dependency doesn't get upgraded because it is pinned
and that got turned into a warning from a normal message. Honestly,
that should be more worrying for the user anyway; it could lead to
a program not working correctly in the worst case.
I also added a message to the `brew pin` command warning about
potential unintended behavior if a dependency gets pinned and another
package requires a newer version of it.
Lastly, I added a commented out deprecation notice for the
`brew upgrade --ignore-pinned` command since it's now the default.
This command, a bit like `install-bundler-gems`, is intended to be run
to ensure that the next invocation of `brew` will not need to try and
install Ruby or Bundler gems.