39 Commits

Author SHA1 Message Date
Alyssa Ross
2a683f2569 upgrade, outdated: follow alias changes 2016-09-18 19:58:09 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Vlad Shablinsky
7fa9c0e977 Update --fetch-HEAD documentation 2016-08-11 09:30:59 +02:00
Uladzislau Shablinski
b8ce1fe1b2 Update upgrade/outdated documentation (#650) 2016-08-06 22:08:35 +08:00
Vlad Shablinsky
9754dbada8
Update upgrade/outdated methods for head versions
Introduce `--fetch-HEAD` option. Without this option upgrade and
outdated never fetch latest upstream commit to detect if HEAD is
outdated -- tabs are used instead. However, if option is passed,
we fetch commit from upstream, which is more time consuming,
but we can be sure that version is up-to-date or outdated.
2016-08-06 21:25:56 +08:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Andrew Thorburn
4c3a6c6022 formula: add missing require.
Closes Homebrew/homebrew#46433.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-27 18:48:38 +00:00
Mike McQuaid
6054666fa6 formula: refactor outdated handling, add to hash. 2015-11-27 16:52:54 +00:00
Xu Cheng
1ae44d4429 use directory? to check rack existence 2015-10-09 19:06:08 +08:00
Xu Cheng
b38498d9dc outdated: fix syntax warning
Library/Homebrew/cmd/outdated.rb:27: warning: shadowing outer local variable - dir
2015-09-06 20:15:38 +08:00
Vlad Shablinsky
fc445d97d3 outdated: update error for different taps
Closes Homebrew/homebrew#43269.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-27 13:51:05 +01:00
Xu Cheng
0bf2f92f46 outdated: remove unnecessary nested if 2015-08-15 16:18:17 +08:00
Mike McQuaid
49dce3e7ae outdated: check if formula needs to be migrated.
Closes Homebrew/homebrew#42938.
2015-08-14 15:18:45 +01:00
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
Xu Cheng
c07f4ad737 outdated: output full name
Closes Homebrew/homebrew#41099.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-26 16:56:22 +08:00
Xu Cheng
e04f115f8d outdated: inline method 2015-06-26 16:56:22 +08:00
Jack Nagel
2bc40ff385 Pull complex condition out of loop 2015-06-25 19:33:47 -04:00
Colin Dean
e12295849d Adds JSON output to outdated command
After some musing on brunophilipe/Cakebrew#71, I thought it would
be useful to let Cakebrew and other tools grab the outdated formulae
version information using a method more elegant than regex.

Closes Homebrew/homebrew#30693.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-06-25 19:32:23 -04:00
Xu Cheng
9382557a08 outdated: use Formula#full_name
Closes Homebrew/homebrew#40265.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-01 20:01:49 +08:00
Xu Cheng
ebbeda850a outdated: use ARGV.resolved_formulae 2015-05-27 13:53:41 +08:00
Jack Nagel
a4ff45e5ee Use pkg_version when comparing against keg versions 2015-04-01 21:15:18 -04:00
Jack Nagel
abb0cb3aa0 Switch to a more useful serialization of tap info
Closes Homebrew/homebrew#37383.
2015-03-14 21:14:37 -04:00
Mike McQuaid
d57d63ad62 outdated: further fix tap version handling.
Closes Homebrew/homebrew#37317.

Closes Homebrew/homebrew#37480.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-07 16:26:29 +00:00
Mike McQuaid
e34d9a7b37 outdated: handle HEAD, URL and path installation.
Handles edge cases missed in Homebrew/homebrew#36699.

Closes Homebrew/homebrew#36741.

Closes Homebrew/homebrew#36760.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-13 10:58:43 +00:00
Mike McQuaid
988ec8de98 outdated: handle fully qualified tapped formulae.
Previously if I did `brew install boxen/brews/imagemagick` and then `brew
upgrade boxen/brews/imagemagick` and the version of `imagemagick` in
`boxen/brews` was older than the version in `Homebrew/homebrew` then it would
install the correct version from the `boxen/brews` tap and then try to
immediately upgrade it to the version from `Homebrew/homebrew`. I'd argue
fairly strongly that this behaviour is pretty unintuitive; when you fully
specify a formula from a tap then it should be prioritised by `brew upgrade`
and `brew outdated.

This commit makes `brew upgrade boxen/brews/imagemagick` only upgrade the
version of `imagemagick` if the version in the `boxen/brews` tap is newer.
Similarly `brew outdated imagemagick` and `brew outdated
boxen/brews/imagemagick` will show different results if the newer version
differs between `boxen/brews` and `Homebrew/homebrew`.

Closes Homebrew/homebrew#36699.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-11 14:22:48 +00:00
Jack Nagel
9db8580414 Explicitly pass formulae to outdated_brews 2015-01-04 00:41:24 -05:00
Jack Nagel
43aa00227a Get rid of mixed operator styles 2015-01-03 17:54:07 -05:00
Mike McQuaid
426737eb9e outdated: allow passing formulae as arguments.
If formulae names are passed as arguments check if just they are outdated. Additionally, return a failed code if they are outdated.

This will hopefully be able to stop people complaining about the outdated error code as they can now just run e.g.:
`brew outdated git && brew upgrade git`

Closes Homebrew/homebrew#31242.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-08-01 17:46:05 +02:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Adam Vandenberg
579c0e898f outdated: allow forcing verbose output
Closes Homebrew/homebrew#27813.
2014-04-30 21:10:47 -07:00
Jack Nagel
17032a600c Teach commands to work with revisions 2014-03-05 20:12:51 -06:00
Jack Nagel
dd9346ada2 outdated: yield version list rather than recreate it 2013-05-24 11:13:27 -05:00
Jack Nagel
8b763acc2a outdated: always do comparisons with a Formula as the receiver
It is possible for the object returned by Formula#version to be a
subclass of Version with special behavior, so we want to use that for
the comparison.
2013-05-14 20:11:48 -05:00
Mislav Marohnić
aa7864c5ca proper version sort in outdated command
c.f. Homebrew/homebrew#16382.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-12-04 21:10:03 -06:00
Jack Nagel
20fdc5cd2f Simplify brew outdated even further
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-30 20:39:46 -05:00
Jack Nagel
93baea7e47 outdated: use new version comparison machinery 2012-08-18 11:12:10 -05: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
Max Howell
768910283a Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00