260 Commits

Author SHA1 Message Date
Max Howell
6988a75b84 Don't allow sudo brew upgrade if not sensible 2012-03-07 12:50:15 +00:00
Max Howell
a13ff43886 Don't abort upgrade if one formula won't build
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.
2012-03-07 12:34:40 +00:00
Jack Nagel
86e7c8a772 upgrade: unlink relative to the correct keg
Calling Keg#unlink on "#{f.rack}/#{f.version}" will perform the unlink
relative to the _new_ keg, rather than the keg we are upgrading from.
Fix this by resolving the linked_keg entry and unlinking relative to it.

Fixes Homebrew/homebrew#10296.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-20 15:14:31 -06:00
Charlie Sharpsteen
a404ceb29a brew-upgrade: Fix installation of dependencies
Fixes Homebrew/homebrew#7528.
Closes Homebrew/homebrew#7572.
2011-09-16 09:02:02 -07:00
Charlie Sharpsteen
2492c6564d Return Formula objects from outdated_brews
Previously, `outdated_brews` returned a list of lists---each containing three
components of a Formula object:

  - f.rack
  - f.name
  - f.version

Frequently more information is required which necessitates back-casting from
`name` to a Formula object---simpy returning formula objects removes this step.
2011-09-16 08:55:38 -07:00
Charlie Sharpsteen
94dba21f7d Centralize definition of rack in formula.rb
`rack` is a commonly used alias for `formula.prefix.parent`---so common that it
gets defined and used quite a bit. This patch makes `rack` an official method
of the `Formula` class.
2011-09-16 08:55:38 -07:00
Max Howell
34aea5c987 Handle brew upgrade ARGV errors properly
Fixes Homebrew/homebrew#7304.
2011-09-02 12:12:30 +01:00
Charlie Sharpsteen
e527c1c83a Leopard: Eliminate moar Array.count from brew upgrade 2011-08-25 18:02:36 -07:00
Charlie Sharpsteen
f7bd98875b Leopard: Fix undefined method count for Array
Leopard runs Ruby 1.8.6 while Snow Leopard runs 1.8.7 and `Array.count` was not
introduced until 1.8.7.

Using `Array.length` instead.
2011-08-24 17:45:19 -07:00
Max Howell
19e387d92e brew upgrade
Consequence: you can no longer install when something is already installed, you must upgrade it. This doesn't apply if the formula in question was unlinked. You can still --force installs though.

Rationale: the old way of installing over the top would leave symlinks to multiple versions in /usr/local if the old version had a file the newer version didn't. The new upgrade command handles everything properly.
2011-08-24 22:30:43 +01:00