2345 Commits

Author SHA1 Message Date
Jack Nagel
56fe164e95 Teach download strategies to take a SoftwareSpec
Now that a URL, version, and the (for lack of a better term) "specs"
associated with said URL (e.g. the VCS revision, or a download strategy
hint) are neatly bundled up in a SoftwareSpec object, it doesn't make
sense to pass them individually to download strategy constructors. These
constructors now take only the formula name and a SoftwareSpec as
parameters.

This allows us to move mirror handling out out of Formula#fetch and into
the download strategies themselves. While doing so, we adjust the mirror
implementation a bit; mirrors now assume the same "specs" as their
owner's URL. They are still only useable by the CurlDownloadStrategy,
but this provides a basis for extending mirror support to other
strategies.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:35 -05:00
Jack Nagel
af53f54b24 fetch: use new checksum verification
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
b2ff74372e Refactor download strategy detection
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
93f8c71e21 tests: clean up whitespace
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
40b531deb1 Demonstrate that bottles are selected correctly
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
90dbb8a141 Prune some requires from test files
testing_env already requires utils; set up the ARGV and ENV extensions
there as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
76b2eee777 Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Jack Nagel
2c6e93cf8a audit: handle new formula specs 2012-07-04 22:47:33 -05:00
Jack Nagel
6420943552 info: display available formula specs 2012-07-04 22:47:33 -05:00
Jack Nagel
b6d44dd38a fetch: make use of new formula specs 2012-07-04 22:47:33 -05:00
Jack Nagel
98a11b8e57 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Jack Nagel
ca71c038a1 Cache Hardware.is_64_bit?
IO#popen is called for each call to Hardware.is_64_bit?; this becomes
costly when it is repeatedly invoked. Luckily it is an invariant, so we
can store it in a class variable.

False is a valid value for this method, so the usual ||= idiom is not
applicable.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-02 01:10:21 -05:00
Jack Nagel
168ccb2821 Update formula template for new X11 dependency
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 14:32:28 -05:00
Jack Nagel
1d2a72eecc Dump Cmake environment variables in brew --env
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 13:51:23 -05:00
Jack Nagel
e65c3a71eb Update doctor checks for XQuartz
- pkg-config no longer defaults to checking /usr/X11/lib/pkgconfig;
   instead this path is added via ENV.x11 or depends_on :x11. Formulae
   that expect X11 libs should be explicitly marked as depends_on :x11.
 - Remove warning about /usr/X11 as a symlink.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 12:23:19 -05:00
Camillo Lugaresi
89f86dc283 Better describe X11 in brew --config 2012-07-01 12:20:47 -05:00
Camillo Lugaresi
4488c3546d Better error message for unknown dep symbol 2012-07-01 12:19:37 -05:00
Camillo Lugaresi
4416955495 ENV.x11 automatically if depends_on :x11 2012-07-01 12:19:01 -05:00
Camillo Lugaresi
4c10eaf332 Add depends_on :libpng as an alias to :x11
Some formulae ask for the x11 environment with ENV.libpng; mirror this
in the new dependency form.
2012-07-01 12:17:49 -05:00
Camillo Lugaresi
1847595168 Simplify DependencyCollector#add 2012-07-01 12:15:09 -05:00
Camillo Lugaresi
243b14a090 depends_on :x11 syntax support 2012-07-01 12:14:06 -05:00
Camillo Lugaresi
65567eb55f add method to find XQuartz version 2012-07-01 12:12:44 -05:00
Camillo Lugaresi
a07085df2d use XQuartz when present 2012-07-01 12:10:32 -05:00
Jack Nagel
17e7b7eaa4 Clarify comment
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-30 14:10:03 -05:00
Jack Nagel
cfe58531ee Address some style issues in MacOS module
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-30 14:01:07 -05:00
samueljohn
4aed55cccb doctor: suggest the correct xcode-select path to the user
Shortened the part about the CLT-only systems, because this message is
never shown to them.

Closes Homebrew/homebrew#13061.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-29 12:40:26 -05:00
Jack Nagel
8f6ee31004 Add mdfind method to MacOS module
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-29 12:40:26 -05:00
Jack Nagel
60b518278b Refactor PATH setup
- Make ORIGINAL_PATHS an array of Pathnames instead of strings
 - Append the dev tools path once in global.rb instead of build.rb

Closes Homebrew/homebrew#13075.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-29 00:55:01 -05:00
Jack Nagel
f2e076e5cc Organize compiler methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-28 14:12:50 -05:00
Adam Vandenberg
0bb95960e6 Extract MacOS module to separate file 2012-06-27 12:09:57 -07:00
Adam Vandenberg
b37c5bed61 Refactor MacOS.
* call `xcode-select` once and cache the result
* reuse functions where appropriate
2012-06-27 12:08:14 -07:00
Adam Vandenberg
c32e67b83c remove confusing comments 2012-06-27 11:55:42 -07:00
samueljohn
13e14ef65a Fix Homebrew/homebrew#13012 properly and don't set the SDK if CLT
Undoing parts of the hot fix 78b9e8548e771a59e382e6f13339664ec5498391.

The only thing missing was to check for `system "/usr/bin/xcrun -find make 1>/dev/null 2>&1"`
and then it's safe to call locate.

This commit restores the original functionality but without the risk for recursion
and improves the logic of `MacOS.locate`. See below.

To important changes in this commit:

- For Xcode _and_ CLT: don't add the SDK and leave things as before.
So if `MacOS.clt_installed?`, then no `SDKROOT` and `-L` and `-I`
directories are set in `ENV.macosxsdk`.

- Improved the logic for `MacOS.locate` for Xcode-only situations
by assuring that the xcode-select path is correct. This is done
by checking that `bin/make` exists and is executable. Otherwise it
was possible to set xcode-select to an empty dir.
This check is done in `MacOS.sdk_path` too.
We are now able to use Xcode wherever it is and can work even, if
xcode-select is set to invalid values. (Remember some users don't
have sudo access and that is needed to fix xcode-select).

Some minor whitespace fixes.
Minor backtick fix in doctor.rb's printout.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-27 11:50:43 -07:00
Adam Vandenberg
dcc2765947 Homebrew 0.9.1
Bump the version number due to the Xcode/CLT change.
0.9.1
2012-06-27 10:28:24 -07:00
Adam Vandenberg
62f269d0aa Simplify check_non_libraries 2012-06-27 10:21:28 -07:00
samueljohn
212dc98003 doctor: check for ~/.pydistutils.cfg
Closes Homebrew/homebrew#12363.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-26 19:41:22 -05:00
Jack Nagel
87543a6916 config: omit Xcode path for CLT-only systems
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-26 12:20:04 -05:00
Jack Nagel
9189258a9e Clean up --config output
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-26 00:02:42 -05:00
Mike McQuaid
ef65f3654f Improve bug report wiki page text.
Fixes Homebrew/homebrew#12674.
2012-06-25 19:49:44 -05:00
Misty De Meo
bfec2ac090 MacOS.sdk_path: silence stderr from xcode-select 2012-06-25 16:48:06 -05:00
Misty De Meo
f231a8b079 MacOS.sdk_path: use strip instead of chomp.chomp 2012-06-25 16:00:07 -05:00
Misty De Meo
cd34b164b2 MacOS.sdk_path: make sure xcode-select is sane
According to a user on IRC with a brand-new Mac, xcode-select is preconfigured
to /Developer out of the box even though that doesn't exist on modern Xcode.
So we shouldn't trust that it makes any sense.
2012-06-25 15:52:40 -05:00
Misty De Meo
31d152780b MacOS.sdk_path: chomp harder!
There were two newlines being returned by the command being called in sdk_path,
not just one.
2012-06-25 15:47:45 -05:00
Misty De Meo
2baf6487d1 Hotfix for stack overflow
Under certain circumstances, MacOS.locate and MacOS.dev_tools_path would call
each other recursively. This was limited to systems with Xcode minus the CLT.
See Homebrew/homebrew#13012.
2012-06-25 15:13:35 -05:00
Charlie Sharpsteen
f165e0cf5f brew-upgrade: Respect --ignore-dependencies flag
Passing `--ignore-dependencies` to `brew upgrade` will now have the desired
effect.
2012-06-25 09:20:18 -08:00
Misty De Meo
b9f4b682b5 StandardCompilers: add Xcode 4.3.3 2012-06-25 09:42:05 -05:00
samueljohn
725feb3db1 Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!

Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)

Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.

Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.

Closes Homebrew/homebrew#10510.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-24 19:11:06 -07:00
Tim Oram
3147dd134a doctor: rewrite Volume class to fix issue with google update engine
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-23 10:18:16 -07:00
Misty De Meo
0d2e26fc58 doctor: skip missing_deps when no Cellar exists
Another fix for Homebrew/homebrew#5188.
2012-06-19 10:08:19 -05:00
Misty De Meo
d1baf42d94 doctor: skip outdated_homebrew check when no git 2012-06-19 10:03:11 -05:00