123 Commits

Author SHA1 Message Date
Jack Nagel
b160cc9bb6 Handle tap file renames that remove a file from the formula directory 2014-07-31 15:58:03 -05:00
Jack Nagel
87850d00cd Remove obsolete hacks from updater report 2014-07-26 20:11:53 -05:00
Jack Nagel
2b90995c3e Only populate the report with formula paths 2014-07-26 20:11:53 -05:00
Jack Nagel
197a12c900 Switch from backticks to Utils.popen_read 2014-07-26 20:11:53 -05:00
Jack Nagel
802775078c Separate reading and parsing the diff 2014-07-26 20:11:53 -05:00
Jack Nagel
6baf357f8c update: remove unused rename detection
Right now this code only produces false positives. When we have real
support for renames, we can implement it more carefully.

Closes Homebrew/homebrew#31126.
2014-07-25 12:28:05 -05:00
Jack Nagel
2cf116464d update: simplify diff parsing 2014-07-25 12:25:58 -05:00
Jack Nagel
44254aa9cf Remove redundant "which git" guards
There is always a git executable on PATH due to the git wrapper in
Library/Contributions/cmd. The wrapper will notify the user if there is
not a real git installed.
2014-07-06 14:10:52 -05:00
Jack Nagel
2d83c08592 Make tap_ref match similar code in update 2014-07-06 13:12:01 -05:00
Jack Nagel
f8fb74ff76 Escape paths in regexps 2014-07-06 11:25:56 -05:00
Jack Nagel
7cd31377a4 Convert update report to use composition 2014-06-27 21:58:15 -05:00
Jack Nagel
346fa5098f Simplify valid_formula_location? method 2014-06-27 21:58:15 -05:00
Jack Nagel
3dbcba0c03 Call original backtick using super 2014-06-23 18:50:55 -05:00
Jack Nagel
8d12684efe Pass repository path into the updater 2014-06-23 18:41:50 -05:00
Jack Nagel
f0e13ee97b Use multiple argument form of system 2014-06-20 18:37:24 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Jack Nagel
bf365fc23b Prefer Dir.glob when iterating over the result 2014-05-31 23:53:36 -05:00
Tsukasa OMOTO
d1f15e967b Taps: cleanup regexps around Taps
Closes Homebrew/homebrew#29139.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-05-14 11:12:51 -05:00
Jack Nagel
d8c15c8fbf The \w character class already includes underscore
Newer versions of Ruby issue a warning for repeated character classes.
2014-05-03 15:03:22 -05:00
Jack Nagel
b40a3413e3 Pass around only absolute paths when dealing with taps 2014-04-25 18:36:31 -05:00
Jack Nagel
a0494441d3 Build relative paths using resolved_path and relative_path_from 2014-04-25 12:34:37 -05:00
Jack Nagel
9b60c1470a Less code in begin clause 2014-04-25 12:34:28 -05:00
Jack Nagel
b0cd6b0376 Extract some boilerplate into an each_tap method 2014-04-25 11:25:38 -05:00
Tsukasa OMOTO
54004a4759 Make the on-disk representation of taps unambiguous
This commit supports "-" and "_" in names of user and repository.

Closes Homebrew/homebrew#28203.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-04-24 17:10:41 -05:00
Mike McQuaid
4dd6f0cb4c install, update: AlreadyTappedError never raised. 2014-01-03 21:57:06 +00:00
Mike McQuaid
228a5a545a update: rewrite origin to point to Homebrew org. 2013-12-14 23:10:20 +00:00
Jack Nagel
6c04ccfb3b Remove unused variables 2013-12-12 15:42:35 -06:00
Jack Nagel
6071e3b54c Fix tap migrations
When a `brew update` pulls down additions to tap_migrations.rb and the
removed formulae in the same update, the migrations will never run,
because tap_migrations.rb is loaded before the update takes place. Fix
this by loading it after the update.
2013-12-02 16:22:40 -06:00
Jack Nagel
f42c7f1cc3 update: add remaining status indicators to diff-tree regexp
As I understand it, we should never encounter these, but...
2013-11-14 09:52:33 -06:00
Jack Nagel
8335401bc3 update: guard against nil in tap migrations 2013-11-14 09:25:27 -06:00
Jack Nagel
f41e1a3b83 Add file type change to git diff-tree regexp
Fixes Homebrew/homebrew#24286.
2013-11-14 09:24:28 -06:00
Mike McQuaid
e24bcba00a update: check if Cellar exists instead of factory.
Fixes Homebrew/homebrew#23881.
2013-11-01 23:23:14 -07:00
Mike McQuaid
d31e069ed3 update: automatically tap migrated formulae.
When a formula is removed from core and installed let's tap it so users
can get updates without caring which tap we want to put things in.

This should allow us to migrate a lot of things to taps.

Closes Homebrew/homebrew#23760.
2013-10-30 11:24:21 -07:00
Mike McQuaid
8d0c8fd978 update: handle realpath exception. 2013-09-24 23:07:01 +01:00
Mike McQuaid
5e13933557 update: untap/retap formulae before/after pull.
This should fix problems like Homebrew/homebrew#19799 where we pull formulae from taps
into core. I want to get something similar merged ASAP so we can pull
GCC into core (see Homebrew/homebrew#20678).

Closes Homebrew/homebrew#19799.
2013-09-24 23:06:10 +01:00
Jack Nagel
4c55082e7c update: restore previous state when interrupted
Fixes Homebrew/homebrew#19460.
Closes Homebrew/homebrew#22375.
2013-09-10 15:12:39 -05:00
phinze
9a94a77fa3 Properly define tapped formulae in update
A tapped formula is a ruby file present:

  - in the root of the tap
  - in directory of the tap called Formula
  - in a directory of the tap called HomebrewFormula

And nowhere else. This corrects an overzealous definition of tapped
formula in the updater. (the correct definition has been in Pathname
since e613cbe5783cea2abb8100b56c22126a1ab6b9f2)

Refs Homebrew/homebrew#19743.
Closes Homebrew/homebrew#21087.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-07-09 20:52:51 -05:00
Adam Vandenberg
a60eed48bc Remove adamv-alt references.
Closes Homebrew/homebrew#20364.
2013-06-09 07:32:06 -07:00
Peter Aronoff
c9563cce95 Fix brew update so that it doesn't show doubles
Under certain conditions, `brew update` will show doubles. It's a rare
edge-case, but if you have a tap where the name of the formula is identical
with the name of the insalled file, then you see output like this:

    ==> Updated Formulae
    aalib				   ssh-copy-id
    casperjs				   sshuttle
    jack				   telemachus/anytap/brew-any-tap
    mogenerator				   telemachus/anytap/brew-any-tap

I believe this should fix that.

Closes Homebrew/homebrew#18495.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-03-16 16:27:46 -05:00
Jack Nagel
1a799f04e6 Remove unused variables 2013-02-18 12:13:35 -06:00
Mike McQuaid
4aacf5400e brew-update: show upgrade command on formula parameters.
Closes Homebrew/homebrew#17814.
2013-02-18 10:40:48 +00:00
Adam Vandenberg
bae3d70834 update: abort if formula names are given
Closes Homebrew/homebrew#11154.
2013-02-03 11:53:17 -08:00
Adam Vandenberg
30114c4c70 brew update: warn about adamv/homebrew-alt 2013-01-06 17:06:38 -08:00
Charlie Sharpsteen
376fa59901 brew-update: Guard non-directory files in Taps
Skip any entries returned by `Dir["Library/Taps/*"].each` that are not
directories.
2012-10-28 12:34:43 -07:00
Christian Schlensker
a6003d08f6 pluralize the word 'Formula' in reports
Closes Homebrew/homebrew#15321.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-10-05 20:16:06 -07:00
Max Howell
ea6bfb66a1 Error handling for individual taps
Possibly would help diagnose: Homebrew/homebrew#13853.
2012-08-01 16:19:25 -04:00
Jack Nagel
68124d481f Unify 'which' and which_s' utility methods
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.

Closes Homebrew/homebrew#12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Jack Nagel
8c4e7ca5b5 Parse raw diff output in brew update
Using each_cons() "works", but to report all changes correctly we need
to look at the last elements even after we've looked at the last 3
consecutive elements.

Instead, let's parse each line of the raw diff output using a regexp.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-23 20:39:24 -05:00
Jack Nagel
9076037a0d Detect and display renames in brew update
Renamed formulae will cease to display as an add/delete pair and instead
end up the in the "Renamed" section. In the future we should be able to
take this information and use it to rename existing kegs during updates,
allowing us to rename formulae without breaking upgrades.

Renaming a formula requires renaming the class, so there will be at
least one add/delete pair in the file. Thus, the similarity threshold
for detecting renames is set at 85% to allow a little bit of content
turnover without losing track of the rename.

Closes Homebrew/homebrew#11158.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00
Jack Nagel
10f8443f8a Use --verify when querying HEAD
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00