56 Commits

Author SHA1 Message Date
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
Mike McQuaid
23b84ef732 Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell
88604e1bb1 Handle when formula are deleted from taps
The symlinks in Formula must be updated.
2012-03-18 01:23:01 +00:00
Max Howell
7280590e88 Link new tapped formula during brew update
Required me to spoil tap's code. All in the name of DRY! Alas!
2012-03-16 21:06:17 +00:00
Max Howell
921f0e5674 brew update will update taps 2012-03-16 21:06:16 +00:00
Jack Nagel
28d6a0f4de update: disable git line ending conversion
If a user has set core.autocrlf = true (which shouldn't ever be used on
OS X, but alas...), a subsequent `brew update` will check out files with
CRLF line endings. Setting core.autocrlf = false in Homebrew's repo
config will override this global setting, and let us check out files
with their in-repository line endings.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-02 18:37:48 -06:00
Max Howell
e26797f471 Allow brew update --rebase 2011-09-20 02:30:31 +01:00
Jack Nagel
536446b664 Use HTTPS during brew update
Closes Homebrew/homebrew#7527.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-10 16:24:51 -05:00
Misty De Meo
69e766a699 fix brew update treating command changes as deletions
`brew update` was treating all changes to internal commands as
deletions due to a typo, resulting in spurious notifications of removed
commands.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-31 12:16:01 -05:00
Jack Nagel
54e7eb3b90 update: make git pull update origin/master
Specify the refspec 'refs/heads/master:refs/remotes/origin/master' so
that the remote-tracking branch origin/master gets update during `brew
update` (git-pull updates remote-tracking branches when invoked
like `git pull` or `git pull origin`, but not `git pull origin master`).

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-31 12:10:49 -05:00
Max Howell
7c5073fff2 Feature new/removed internal commands
Removed updated external commands, like seriously, who cares? We could add it back as if --verbose is set I guess but in all honesty, if nobody complains then nobody cared.

# We removed many redundant comments
Removed many redundant comments.

Fixes Homebrew/homebrew#7191; though it could be fixed better.
2011-08-26 13:26:46 +01:00
Max Howell
0d6aff5e1b Fix brew update after new install for real this time?
Fixes Homebrew/homebrew#7220.
2011-08-26 11:25:09 +01:00
Max Howell
98fc60db69 brew update uses origin rather than full URL
This is more flexible for forks and personal customisations, and also more useful for us collaborators since the origin HEAD will be kept up-to-date.
2011-08-25 01:20:33 +01:00
Max Howell
31885c2a99 Constants that are used once are dumb
It just means nobody knows what is being done without scrolling up and down, up and down the file like a doofus on a pogo stick.
2011-08-24 22:30:42 +01:00
Max Howell
554147fa99 Reset --hard after the first git init
We don't know what revision the tarball was when homebrew was installed, so all we can do really is hard reset. In theory some set of git commands should suffice, but apparently --soft and --mixed resets ended up putting stuff in the index which would break subsequent `brew updates`.

Fixes Homebrew/homebrew#6851
2011-08-06 11:11:06 +01:00
Jack Nagel
fd6c9833c6 Fix brew update local changes bug
Users were seeing local changes in their repository after updating, even
though they had made no local changes.

The repository setup sequence should use `git reset --soft` rather than
vanilla `git reset`, which defaults to '--mixed'. '--soft' updates
_only_ HEAD, leaving the index as-is, allowing future incantations of
`brew update` to proceed without errors.

Fixes Homebrew/homebrew#6732.
2011-08-02 13:21:06 +01:00
Adam Vandenberg
f30893a968 Fix brew update on Leopard 2011-07-31 10:32:09 -07:00
Max Howell
98ffbeb8f5 Make the check for a valid git repo better
Because the new installer creates the .git directory when it installs.
2011-07-29 14:55:41 +01:00