72 Commits

Author SHA1 Message Date
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Mike McQuaid
f4af833714 Revert "upgrade: announce usage of --all."
This reverts commit 9032f165bec3d0c7452169093fab32578816043b.

This seems to have been universally unpopular so let's revert it.

Closes Homebrew/homebrew#40372.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-05 14:20:21 +01:00
Xu Cheng
082ce482fc upgrade: use Formula#full_name 2015-05-29 17:02:23 +08:00
Xu Cheng
e744e8b0f9 upgrade: use ARGV.resolved_formulae 2015-05-27 13:53:42 +08:00
Mike McQuaid
c725059251 upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if
you wish to upgrade all formulae.

Closes Homebrew/homebrew#38572.
2015-04-26 19:40:33 +01:00
Mike McQuaid
28f26e0c9f reinstall, upgrade: tweak use of tab build_bottle.
In the case where a bottle wasn't around before and is now it probably
doesn't make sense to use `build-bottle` to build something that will
be identical to the binary bottle package anyway. After all, when you
use the bottle you will end up with something that has been built with
`build-bottle` anyway (just not by you).
2015-03-24 12:11:40 +00:00
Jack Nagel
4398660cdd Checkout outdatedness in brew upgrade <formula>
Fixes Homebrew/homebrew#35523.
2015-01-04 14:03:56 -05:00
Jack Nagel
9db8580414 Explicitly pass formulae to outdated_brews 2015-01-04 00:41:24 -05:00
Jack Nagel
e1bfbad810 Make quieter an installer mode 2014-11-03 21:43:11 -06:00
Jack Nagel
7266ecd4e3 Hide install receipt key names 2014-10-15 01:30:56 -05:00
Jack Nagel
f3b7c3236b Consistently call name on formula instead of relying on to_s 2014-09-14 11:19:30 -05:00
Larry Shaffer
b6cca78e05 Upgrade honors build_bottle? and built_as_bottle options
Closes Homebrew/homebrew#31628.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-08-17 15:36:24 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Adam Vandenberg
8d44db6b40 pluralize formulae in tap/untap
Closes Homebrew/homebrew#28560.
2014-05-26 18:33:31 -07:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
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.
2014-04-05 12:17:19 -05:00
Jack Nagel
a72061c59a Check existence of target keg instead of hiding exceptions 2014-03-24 11:00:55 -05:00
Jack Nagel
3b68723fa8 Make FormulaInstaller setup more readable 2014-03-13 15:59:54 -05:00
Jack Nagel
ce5e2aa65c Make debug an installer mode 2014-03-13 15:59:54 -05:00
Jack Nagel
4d02849d43 Make verbose an installer mode 2014-03-13 15:59:54 -05:00
Jack Nagel
60caf14ce2 Don't set installer options to their default
ignore_deps and show_header default to false.
2014-03-13 15:59:53 -05:00
Jack Nagel
a911dd5066 Make build_from_source an explicit installer mode 2014-03-10 14:56:02 -05:00
Jack Nagel
17032a600c Teach commands to work with revisions 2014-03-05 20:12:51 -06:00
Jack Nagel
1ab5943fb2 Let commands decide what mode the installer should use 2014-03-04 14:06:25 -06:00
Jack Nagel
4c0db19538 Extract installer setup to prelude method 2014-03-04 14:06:25 -06:00
Jack Nagel
de254f6cd6 Stop mutating build options in upgrade 2014-03-02 14:02:18 -06:00
Jack Nagel
c534b1907d Revert "Let commands decide what mode the installer should use"
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.
2014-03-02 09:01:50 -06:00
Jack Nagel
47f22d20af Fix typo 2014-03-02 00:30:09 -06:00
Jack Nagel
ffbe5bf22c Let commands decide what mode the installer should use 2014-03-02 00:21:13 -06:00
Jack Nagel
ea85812c58 Reduce the number of ways options can be passed to the installer 2014-03-02 00:03:08 -06:00
Drew Rodman
d63ef14794 Add DownloadError to catch a broader range of resource download errors.
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.

Fixes Homebrew/homebrew#18364.
Closes Homebrew/homebrew#26618.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-02-18 15:08:03 -05:00
Frizlab
5de3686cd2 upgrade: fix output when no packages to upgrade.
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>>

Closes Homebrew/homebrew#26157.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-01-26 18:04:20 +01:00
Nikolaus Wittenstein
f17289f708 upgrade.rb: Fix plural_s when number = 0
Currently Upgrade prints out:
"Upgrading 0 outdated package, with result:"

This change makes it print:
"Upgrading 0 outdated packages, with result:"
correctly pluralizing "packages".

Closes Homebrew/homebrew#22854.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-09-26 22:54:51 -07:00
Adam Coffman
753adbb0ce upgrade: put exit statements in both conditional branches
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.

Closes Homebrew/homebrew#21316.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-07-18 15:35:17 -05:00
Jack Nagel
9fb163d34c upgrade: don't rely on return value of 'onoe' 2013-07-15 23:47:04 -05:00
Jack Nagel
42cceeb4a0 upgrade: make condition clearer 2013-07-15 23:47:03 -05:00
Jack Nagel
b4419992ab upgrade: move require out of method body 2013-07-15 23:47:03 -05:00
Jack Nagel
1678a4a65d upgrade: remove redundant conditional
Since e1c62c35465eb6149688c745e4309438c08c410b, we exit early if the
outdated array is empty, so we no longer need to check this before
proceeding.
2013-07-15 23:47:02 -05:00
Adam Vandenberg
4c9ac19e87 Consolidate sudo checks.
Closes Homebrew/homebrew#20318.
2013-06-08 20:44:56 -07:00
Jack Nagel
5f38c19ba8 upgrade: fix expansion of options for top-level formula objects
Fixes Homebrew/homebrew#20045.
2013-05-24 10:33:08 -05:00
Jack Nagel
40dedcec70 upgrade: fix typo 2013-05-18 22:11:19 -05:00
Jack Nagel
a10cda77be upgrade: use a method rather than a boolean flag 2013-05-18 22:09:15 -05:00
Jack Nagel
26a076eef5 upgrade: tighten installed precondition 2013-05-18 22:09:15 -05:00
Simon Sigurdhsson
f8a88b5f28 brew-pin: prevent selected formulae from upgrade.
* 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.
Closes Homebrew/homebrew#18515.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-30 19:50:47 +00:00
Jack Nagel
5ac4e4f071 upgrade: use standard Tab accessor
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.
2013-01-26 12:14:51 -06:00
Jack Nagel
82051a56ec upgrade: offload dependency expansion to FormulaInstaller
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.
2013-01-26 12:14:49 -06:00
Jack Nagel
951872c4be FormulaInstaller: don't install bottle if options were passed 2013-01-26 12:14:46 -06:00
Jack Nagel
5822aa80cf FormulaInstaller: make tab an attr, but never a parameter 2013-01-26 12:14:46 -06:00
Matt Di Pasquale
e9158ca6dc brew upgrade: improve exit codes.
exit 1 if formulae given but none outdated

Closes Homebrew/homebrew#17199.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-21 19:55:09 +00:00
Jack Nagel
5c799ef8c8 Don't attempt installation multiple times
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.

Fixes Homebrew/homebrew#16957.
2013-01-10 16:46:54 -06:00
Charlie Sharpsteen
93dca5fb38 upgrade.rb: Generate Tab from Keg not Formula
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.
2012-12-18 15:12:10 -08:00