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.
Finder activity such as moving the position of an icon can create an unexpected
.DS_Store file in a Cellar directory. This causes `brew remove --force` to throw
an error that is reported as
Error: Directory not empty - /usr/local/Cellar/<formula>
This fix avoids that error, by calling rmtree rather than rmdir.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
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`.
FixesHomebrew/homebrew#6851
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.
FixesHomebrew/homebrew#6732.
The output happens as it is determined, rather than all at once, which is preferable for CLI commands. This meant I had to hard-code the left-justification.
The pre-amble warning is removed. Instead the command outputs the git checkout command for each she that you can type to get that old formula.
I decided that reseting the one file will work 99% of the time and that it is too risky to reset the whole repo, this will roll-back bug fixes. Instead we should add functionality to compat/ in order to support old formula as required. Sometimes deps may have to be rolled-back too, but the user will have to figure this out on an ad-hoc basis. We are assuming a failure sophisticated user anyway, one who would like to get old versions of stuff.
I moved most of the functions into Formula since IMO this makes more conceptual sense.
I made the she get abbreviated by git (using --abbrev-commit) itself so it as short as can be.
Provided the user installed with our installer anyway. It creates all the directories that Homebrew will need during its life thus negating the need for root writability.
Currently, `brew doctor` complains about GREP_OPTIONS being set,
regardless of its value. The cmake formula, for which this check was
introduced, is more specific about what actually makes it fail.
GREP_OPTIONS='--color=auto' will not cause the build to fail, so don't
warn about this.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
XCode 4.x only includes GCC 4.2. Therefore, having `brew doctor` report that
GCC 4.0 is missing only spreads fear, uncertainty and doubt over a situation
that is status quo.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
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.
ClosesHomebrew/homebrew#6017.
This fixes reporting of which formulae changed in git versions where `pull`
output is not compatible.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>