1319 Commits

Author SHA1 Message Date
Jack Nagel
9b3c22c7bd Pretty-print the "Trying a mirror" message
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-19 12:15:56 -05:00
Charlie Sharpsteen
3ada407922 mirror support: Add test 2011-09-19 09:25:02 -07:00
Charlie Sharpsteen
9d19506ee9 mirror support: Add mirror method to Formula.rb
Mirrors can now be declared using the `mirror` method which works similar to
`depends_on` and takes the same arguments as `url`.

The formula class now has a public `fetch` method that cycles through the
mirror list if the downloader for the primary URL throws a `DownloadError`.
Other brew commands, like brew-fetch, also benefit from mirror support by using
this method.

Closes Homebrew/homebrew#7574.
2011-09-19 09:24:43 -07:00
Charlie Sharpsteen
ff7c886556 exceptions.rb: Add DownloadError
`DownloadError` is an exception that download stratigies can throw to indicate
that a fetch was incomplete due to a failure in communication.

The `curl` method in `utils.rb` has been upgraded to throw a `DownloadError` if
something bad happens to `curl` execution.
2011-09-19 09:21:36 -07:00
Adam Vandenberg
3898010309 doctor: restore some line breaks 2011-09-16 10:05:11 -07:00
Charlie Sharpsteen
a404ceb29a brew-upgrade: Fix installation of dependencies
Fixes Homebrew/homebrew#7528.
Closes Homebrew/homebrew#7572.
2011-09-16 09:02:02 -07:00
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
d95e7079a2 Reset to remote master when updating git clones
When installing with --HEAD, cached repo clones do "git fetch origin"
followed by "git reset --hard". This will only reset the working tree
and index to the state of the local HEAD, but Homebrew will think it's
updated and install anyway. "git reset --hard origin/master" will
achieve the desired result.

Should fix Homebrew/homebrew#7613.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-13 22:26:36 -05:00
Charlie Sharpsteen
555b9d149f formula_installer.rb: Call link before check_PATH
Otherwise, for formula that making the very first install into `sbin`, the
following line will fail with a critical error:

    bin = (HOMEBREW_PREFIX/bin.basename).realpath.to_s

Because `sbin` will not exist until after `link` runs.

This isn't very clean as it moves `check_PATH` away from the other checks in
`caveats`, but I couldn't think of a better hotfix that did not require a bit
of code shuffling and re-writing.
2011-09-13 19:40:51 -07: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
Kevin Moore
16f659451a Python easy_install just needs the package
adding 'install' to the command line breaks things

Closes Homebrew/homebrew#7489.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-09-11 12:23:31 -07:00
Kevin Moore
3b30760f5b UnsatisfiedExternalDependencyError: init error
Pass message and formula to super so useful output occurs.

Closes Homebrew/homebrew#7507.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-09-11 09:44:49 -07: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
bf3433bde7 With xcodebuild don't set CC, CXX, etc.
The compiler setting in the xcodeproj is overridden by the CC setting in the environment. This is a bit insane IMO since the xcodeproj itself has detailed decisions about what tools to use.

Fixes Homebrew/homebrew#6406.
2011-09-10 11:30:00 +01:00
Max Howell
0a0187feed Tune optimisations for sandybridge 2011-09-09 09:26:59 +01:00
Max Howell
c959b37227 The doctor notices modifications to Homebrew core
Refs Homebrew/homebrew#7525.
2011-09-09 09:24:16 +01:00
Chris Ledet
f1cd284f12 Add :sandybridge to hardware_family test
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-08 21:29:51 -05: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
d37918b20f If LLVM isn't installed then fails_with_llvm? is true
This makes sense, I assure you. Fixes Homebrew/homebrew#7458.
2011-09-06 17:51:23 +01:00
Max Howell
5dc302604f MacOS.default_compiler should return something always
Even though we are just guessing if it doesn't correspond to any of the others…
2011-09-06 17:12:26 +01:00
Max Howell
06795b8953 Allow :force for ENV.gcc
This is used with fails_with_llvm so that if GCC cannot be found (and we suspect this is the case with Xcode 4.2) the build will fail.

Quite possibly it should be the default.
2011-09-06 11:22:22 +01:00
Max Howell
65d4b2378a Remember compiler setting when it is changed via eg. ENV.gcc
Thus it will be correct after the setting is changed.
2011-09-06 11:22:22 +01:00
Max Howell
6d075a3b17 Check even more carefully for xcode_version
Refs Homebrew/homebrew#7236, though honestly I just think @dsarch hasn't updated.
2011-09-05 18:54:07 +01:00
Max Howell
9cdfd2797f Fix nil handling in brew versions
Fixes Homebrew/homebrew#7392.
2011-09-05 09:44:53 +01:00
Max Howell
6283ca46b7 Use proper issue URL 2011-09-05 09:44:53 +01:00
Max Howell
0f3f0626d3 Don't look for llvm-gcc in xcode_prefix
Look in /usr/bin because all versions of Xcode install it to /usr/bin now and this allows us to support Xcode-less installs of Apple's developer tools.
2011-09-04 12:09:41 +01:00
Jack Nagel
eb52b97a1e tests: actually use bzip for test tarball
I inadvertently gzipped it last night. That in itself doesn't cause any
tests to fail because the download strategy code is robust, but it's
fixed here anyway to be consistent. Basically, I'm dumb.

I also took the opportunity to remove the other resource fork file, so
the tarball is clean.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-02 11:45:56 -05: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
Justin Hileman
8f3a74993b Allow 'brew link' to work with URL-based formulae
Closes Homebrew/homebrew#7373.

Signed-off-by: Max Howell <max@methylblue.com>

I added some comments.
2011-09-02 12:12:30 +01:00
Max Howell
34aea5c987 Handle brew upgrade ARGV errors properly
Fixes Homebrew/homebrew#7304.
2011-09-02 12:12:30 +01:00
Max Howell
7aa45e81cb Guess Xcode version if xcodebuild doesn't exist 2011-09-02 12:12:30 +01:00
Max Howell
a0763dfc2c Remove Xcode dependence from ENV.rb
Fixes Homebrew/homebrew#7329.
Fixes Homebrew/homebrew#7269.
Fixes Homebrew/homebrew#7236.

Also quite a lot of tidy. This should all work fine.

I think we only started referring into xcode_prefix because LLVM used to not
be linked into /usr/bin. But for sure this is no longer true. If someone out
there doesn't link cc etc. into /usr/bin then I guess we can revise this patch
but it's not something we officially supported before, it was just an
accident.

I added a test step in the init code so that a working compiler will always be
selected. This is mainly a fallback for old Xcodes. Though a comment in
another area of the code suggested Xcode 3 on 10.5 doesn't have LLVM so…
2011-09-02 12:12:20 +01:00
Jack Nagel
23dbe43fb7 tests: fix failing test_a_basic_install
The test_a_basic_install was failing because it expected
libexec.children.length to be 1, when in fact there were two files in
the untarred libexec: NOOP, and the Mac OS X resource fork file ._NOOP.

That file is now removed, and the test passes.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-02 01:20:56 -05:00
Jack Nagel
c8d4af5611 update: bring tests up-to-date
The tests for update have been neglected during the last few rounds of
changes, so fix them up.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-02 00:55:20 -05: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
88538c2b4b Fix stripping of keg-only reasons during install 2011-09-01 10:06:28 -07:00
Adam Vandenberg
80335bba74 add brew doctor check for spaces in Xcode path 2011-09-01 09:39:31 -07:00
Max Howell
d71e1d0786 Use GCC if we tested against the latest LLVM
Latest is hardcoded, so we'll have to update as new Xcode's come along.
2011-09-01 14:33:54 +01:00
Max Howell
d5e3c40ca1 Actually obey --use-gcc flag
Schoolboy error.
2011-09-01 14:17:29 +01:00
Dave Bayer
79873bf44a fix: svn update doesn't take url argument
`svn up` doesn't take url argument; compare `svn help up` to `svn help checkout`
Apparently `svn up` can ignore this argument (not documented), but providing this
argument could confuse code readers into believing that changing the url will
switch the branch. It doesn't; the argument is ignored.

This fix was relayed to me, but I've studied it further before posting.
It is related to the bug where --HEAD installs reuse the wrong cache.
Reading the former code, one might hope that providing a changed URL would
have `svn up` change branches. It doesn't; the url was ignored.

Closes Homebrew/homebrew#7159.

Signed-off-by: Max Howell <max@methylblue.com>
2011-09-01 14:03:01 +01:00
Dave Bayer
4743bc96e2 Fixes Homebrew/homebrew#7114; Cache confuses --HEAD and non--HEAD svn installs
Signed-off-by: Max Howell <max@methylblue.com>
2011-09-01 14:01:41 +01:00