Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
I'd still like to make this change, but at least for now the initializer
requires ignore_deps to be set correctly.
This reverts commit 881a8855b944fa9bd7dfd598bb9197f79f7a13f0.
Adding a broader exception class allows for errors raised in Resource.fetch
to be caught in upgrade and prevent the process from being killed when
a download fails. This should resolve issue 18364.
FixesHomebrew/homebrew#18364.
ClosesHomebrew/homebrew#26618.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
When upgrading, if the only package to upgrade is a
pinned package, the output looked like that:
==> Upgrading 0 packages, with result:
==> Not upgrading 1 pinned package:
<<package_name & version>>
The blank line is not beautiful. This commit fixes
the output and replaces with:
==> No packages to upgrade
==> Not upgrading 1 pinned package:
<<package_name & version>>
ClosesHomebrew/homebrew#26157.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Currently Upgrade prints out:
"Upgrading 0 outdated package, with result:"
This change makes it print:
"Upgrading 0 outdated packages, with result:"
correctly pluralizing "packages".
ClosesHomebrew/homebrew#22854.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This check was only occurring in one branch of the conditional.
As a result, if you ran `brew upgrade` with no args and there were no packages to upgrade,
the nonsensical message
"==> Upgrading 0 outdated package, with result:"
would be printed.
ClosesHomebrew/homebrew#21316.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
* Added `pin` et. al. to manpage.
* Added `brew pin` to `brew.1` * Added `brew unpin` to `brew.1`
* Added `brew list --pinned` to `brew.1`
* Added information about frozen formulae to `brew upgrade` in `brew.1`
* Added `pin` et.al. to completion scripts.
* Unpin formulae when uninstalling them
* Unpin and re-pin formulae when upgrading (avoids stale symlink)
References Homebrew/homebrew#18386.
ClosesHomebrew/homebrew#18515.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Yes, the formula object does refer to a version that has not yet been
installed, but we were not looking into Formula#prefix, but #linked_keg,
which is version agnostic (since the original patch was committed, we
Tab#for_formula learned to look into #opt_prefix as well). The rest of
the logic is already embedded in the Tab accessors.
Now that FormulaInstaller does dependency expansion the _right_ way,
avoid duplicating the logic in upgrade. Instead, offload it to the
installer, which will generate an exception in check_install_sanity that
we can safely ignore when formulae in the outdated list are upgraded as
part of the dependency tree of another outdated formula.
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.
For example:
$ brew install graphviz pkg-config
==> Installing graphviz dependency: pkg-config
...
==> Installing graphviz
...
Error: pkg-config-0.27.1 already installed
We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.
FixesHomebrew/homebrew#16957.
Two issues were preventing `brew upgrade` from functioning properly:
- `Tab.for_formula` was used to recover options from prior installs. The
problem is that during an upgrade `for_formula` will be directed to a
non-existant install of the newer version and thus returns a forged tab
claiming no options were invoked.
- The assignment to `installer.install_bottle` requires parenthesis in order
to function properly.
Usually, the "foo-version already installed" error is printed by
FormulaInstaller. However, if an up-to-date formula that has outdated
deps is passed on the command line, we proceed to upgrade the deps and
then print a message saying that the formulae given on the command line
is already installed.
Catch this earlier, when the outdated list is being populated, print an
appropriate message, and skip the up-to-date formula.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This serves the same purpose as similar code in FormulaInstaller, but we
duplicate it because we do the dependency expansion in an ad-hoc fashion
here.
FixesHomebrew/homebrew#11863.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Callers of FormulaInstaller now usually unlink the existing keg prior to
running the installer. However, Tab.for_formula uses the LinkedKeg
record to obtain the tab.
Since we need the tab to persist install options across upgrades, we
must start creating the Tab object before unlinking the old keg and
passing it to the FormulaInstaller.
FixesHomebrew/homebrew#11086.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Also, unlink previous keg before installing to prevent issues when existing installed brews cause build problems for the newer installed brew.
If the build fails the active keg is relinked before aborting.
Fixes #10341.