4907 Commits

Author SHA1 Message Date
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
Charlie Sharpsteen
94dba21f7d Centralize definition of rack in formula.rb
`rack` is a commonly used alias for `formula.prefix.parent`---so common that it
gets defined and used quite a bit. This patch makes `rack` an official method
of the `Formula` class.
2011-09-16 08:55:38 -07:00
Max Howell
95ce00729c Check Cellar can be made before installing stuff
Refs Homebrew/homebrew#5188.
2011-09-15 10:57:22 +01:00
Jack Nagel
f4c301a827 audit: improve GNU url check
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-13 23:35:31 -05:00
Jack Nagel
ff9042f650 audit: correctly match SourceForge https URLs
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-13 23:35:31 -05:00
Jack Nagel
b0f5566566 brew-options: add --installed flag
`brew options --installed` will print options for formulae that are
already installed.

Closes Homebrew/homebrew#7565.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-12 15:43:18 -05:00
Jack Nagel
346a973848 audit: check GNU urls
We now prefer "ftpmirror.gnu.org" over the main FTP site.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-12 15:43:02 -05:00
Jack Nagel
adb85c7f38 brew-options: actually skip formulae with no options
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-11 16:25:20 -05:00
Jack Nagel
627a8463a6 doctor: be more robust about git status check
`git status -s` would spit out "fatal: not a git repository" when not in
HOMEBREW_PREFIX or a child directory of HOMEBREW_PREFIX. Specify a
git-dir and work-tree to fix this.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-11 11:12:08 -05: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
Max Howell
c959b37227 The doctor notices modifications to Homebrew core
Refs Homebrew/homebrew#7525.
2011-09-09 09:24:16 +01:00
Max Howell
b145d075c1 Check that /usr/bin/cc exists in brew doctor
Refs Homebrew/homebrew#7454.
2011-09-07 12:18:28 +01:00
Max Howell
9cdfd2797f Fix nil handling in brew versions
Fixes Homebrew/homebrew#7392.
2011-09-05 09:44:53 +01:00
Daemian Mack
74ee65466c Fix typo in brew doctor
Fixes Homebrew/homebrew#7383.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-02 10:00:15 -05:00
Max Howell
34aea5c987 Handle brew upgrade ARGV errors properly
Fixes Homebrew/homebrew#7304.
2011-09-02 12:12:30 +01:00
Jack Nagel
2505ebda67 fetch: fix '--force' for pathnames
`brew fetch --force` was a no-op for formula pathnames when that formula
did not exist in Library/Formula, because `brew --cache #{f.name}`
results in an error for that case.

Fix it by always using f.cached_download.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-01 19:17:13 -05:00
Adam Vandenberg
66841687eb Edit port/fink warning 2011-09-01 10:14:26 -07:00
Adam Vandenberg
3d88bb851e Edit port/fink warning 2011-09-01 10:08:21 -07:00
Adam Vandenberg
80335bba74 add brew doctor check for spaces in Xcode path 2011-09-01 09:39:31 -07:00
Max Howell
d5071d5ded Allow brew install --force again 2011-09-01 10:27:47 +01: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
c0653d7581 Improved no-errors output 2011-08-31 15:38:21 +01:00
Max Howell
bfabfe77dd Only report PATH order diagnosis if conflicts are found
Rationale: brew doctor shouldn't give warnings for a default install. And this particular warning only applies for a small subset of formula: the ones that are "dupes".

If we get reported issues that prove this was a mistake we will revert it.
2011-08-31 15:38:11 +01:00
Max Howell
0aca152f23 Check for missing deps as part of brew doctor 2011-08-31 15:36:29 +01:00
Max Howell
de56768c6e Prune LinkedKegs too 2011-08-28 11:40:03 +01: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
Charlie Sharpsteen
e527c1c83a Leopard: Eliminate moar Array.count from brew upgrade 2011-08-25 18:02:36 -07:00
Charlie Sharpsteen
f7bd98875b Leopard: Fix undefined method count for Array
Leopard runs Ruby 1.8.6 while Snow Leopard runs 1.8.7 and `Array.count` was not
introduced until 1.8.7.

Using `Array.length` instead.
2011-08-24 17:45:19 -07: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
36596de68c Force contributors to define a test by adding it to the create template
A little cheeky but it should help us to maintain higher quality.
2011-08-25 00:53:37 +01:00
Max Howell
94abb42567 Don't include LinkedKegs or Aliases with brew edit 2011-08-24 22:30:44 +01:00
Max Howell
13918ff6d9 Record which keg is linked
Will be useful for a variety of reasons, but for now, I'm just using it to ensure install won't install again if something is already installed (use brew upgrade instead).

But means that brew switch and that can work properly etc.
2011-08-24 22:30:44 +01:00
Max Howell
1f95b07ba5 Fix keg exception pretty output 2011-08-24 22:30:43 +01:00
Max Howell
19e387d92e brew upgrade
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.
2011-08-24 22:30:43 +01:00
Max Howell
4f4d70d457 Prettier brew uses output (columnate) 2011-08-24 22:30:43 +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
e9aaef0e25 Revise cleanup text, we're removing, not uninstalling 2011-08-24 22:30:42 +01:00
Dave Bayer
84eae3c425 Fix uninstall.rb brew remove --force "Directory not empty" error
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>
2011-08-22 20:26:53 -07:00
Max Howell
471dc987e5 Specify that they are symlinks 2011-08-22 10:26:01 +01:00
Max Howell
df113d3ce6 Only error out for sudo brew install
Note this only happens if Homebrew is *not* installed sudo. Which is most of the time true.

Fixes Homebrew/homebrew#6899
2011-08-17 12:30:21 +01:00
Jack Nagel
32c746ef45 Add keg-only text to brew info output
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-08-11 11:46:35 -07:00
Adam Vandenberg
6666494551 brew doctor: do not check TMPDIR if it is not set 2011-08-07 10:01:52 -07: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
Max Howell
48501e8e1f Prettier brew versions output 2011-08-02 14:45:37 +01:00
Max Howell
cb049409e5 Fix brew doctor if sbin directory doesn't exist 2011-08-02 14:45:03 +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
Max Howell
616b52e627 Oops, show proper git checkout command 2011-08-02 12:58:16 +01:00
Max Howell
18a54259e9 Improvements to brew versions
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.
2011-08-02 12:34:33 +01:00