Commit Graph
40 Commits
Author SHA1 Message Date
Mike McQuaid a88da279fb update: handle realpath exception. 2013-09-24 23:07:01 +01:00
Mike McQuaid e82636d17e update: untap/retap formulae before/after pull.
This should fix problems like #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 #20678).

Closes #19799.
2013-09-24 23:06:10 +01:00
Jack Nagel 95020adf9d update: restore previous state when interrupted
Fixes #19460.
Closes #22375.
2013-09-10 15:12:39 -05:00
phinze 90e3fd0f43 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 e613cbe578)

Refs #19743.
Closes #21087.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-07-09 20:52:51 -05:00
Adam Vandenberg f7fbbe79f4 Remove adamv-alt references.
Closes #20364.
2013-06-09 07:32:06 -07:00
Peter Aronoff 59c0b3f916 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 #18495.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-03-16 16:27:46 -05:00
Jack Nagel 33393a2597 Remove unused variables 2013-02-18 12:13:35 -06:00
Mike McQuaid f1748d9f9b brew-update: show upgrade command on formula parameters.
Closes #17814.
2013-02-18 10:40:48 +00:00
Adam Vandenberg f52e367213 update: abort if formula names are given
Closes #11154.
2013-02-03 11:53:17 -08:00
Adam Vandenberg ca13843428 brew update: warn about adamv/homebrew-alt 2013-01-06 17:06:38 -08:00
Charlie Sharpsteen a365abf0ae 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 c1cc99bc7c pluralize the word 'Formula' in reports
Closes #15321.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-10-05 20:16:06 -07:00
Max Howell a732c9b991 Error handling for individual taps
Possibly would help diagnose: #13853.
2012-08-01 16:19:25 -04:00
Jack Nagel 76604c1cd5 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 #12115.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-07 21:05:47 -05:00
Jack Nagel ba85e7563e 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 40599c3ed5 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 #11158.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00
Jack Nagel a58497368b Use --verify when querying HEAD
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-22 22:15:57 -05:00
Mike McQuaid 9c16145d8c Set MACOS_VERSION as 0 on non-OSX platforms. 2012-03-18 15:43:39 +13:00
Max Howell b481aec543 Handle when formula are deleted from taps
The symlinks in Formula must be updated.
2012-03-18 01:23:01 +00:00
Max Howell b584043e63 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 2e86a41e61 brew update will update taps 2012-03-16 21:06:16 +00:00
Jack Nagel ac8240f65a 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 dec4b73aa0 Allow brew update --rebase 2011-09-20 02:30:31 +01:00
Jack Nagel c333ab5444 Use HTTPS during brew update
Closes #7527.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-10 16:24:51 -05:00
Misty De Meo cb1b256f4d 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 2090a0f5cb 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 5e5bbd8f4b 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 #7191; though it could be fixed better.
2011-08-26 13:26:46 +01:00
Max Howell c0710f74fc Fix brew update after new install for real this time?
Fixes #7220.
2011-08-26 11:25:09 +01:00
Max Howell 4a4b88ff69 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 db4e971064 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 9e5e27b425 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 #6851
2011-08-06 11:11:06 +01:00
Jack Nagel cbcd4a32a6 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 #6732.
2011-08-02 13:21:06 +01:00
Adam Vandenberg 1834609769 Fix brew update on Leopard 2011-07-31 10:32:09 -07:00
Max Howell a95473a5a6 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
Max Howell d5a7d18b1c Don’t output "nothing" messages
This is how we do it in general in Homebrew.
2011-06-17 09:30:25 +01:00
Max Howell 57338d3c67 Don’t error out if the Cellar doesn’t yet exist 2011-06-15 13:04:06 +01:00
Max Howell 8bec9b18ef Fix first brew update with Git 1.7.4+; Fixes #5128
Behaviour for git checkout was changed such that the update would fail because it refused to checkout files on to existing files in the working directory.

This was bad behaviour anyway, we should make efforts to keep any local modifications to the Homebrew checkout. Everything is neatly resolved if we just do a --soft reset.

Closes #6017.
2011-06-15 13:02:48 +01:00
Mislav Marohnić cae8f9e21d refactor update command to use git diff instead of parsing pull output
This fixes reporting of which formulae changed in git versions where `pull`
output is not compatible.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-14 14:47:39 -07:00
Jonas Pfenniger 23c35d5909 brew up: star installed formulae
When running `brew up`, if a mentioned formulae is also installed,
it will get a wildcard start at the end.
It makes it easier to see if any installed formulae is impacted.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-21 22:10:39 -07:00
Max Howell 9afc85ad33 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