248 Commits

Author SHA1 Message Date
Misty De Meo
f17429f842 ARGV: add .dry_run? method
Add an ARGV.dry_run? helper method for '--dry-run'/'-n' now that
'-n' is being used as a git-style dry-run in two commands.

Closes Homebrew/homebrew#12898.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-09 12:01:09 -05:00
Misty De Meo
743b5e6feb link: add --force and --dry-run options
`brew link` can now be made to delete any conflicting files using
the --force argument. It also has a --dry-run option, similar to
git clean -n, which will list any files which would be deleted
without touching the filesystem.

Closes Homebrew/homebrew#11811.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-09 12:01:09 -05:00
samueljohn
dd9ef7b71b ENV: remove -L from CFLAGS.
SDK/usr/include and lib now appended instead of prepended.
Prepending overwrote our precedence of HOMEBREW_PREFIX/include and lib.

Closes Homebrew/homebrew#13292.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-07-09 09:36:25 -07:00
Jack Nagel
9a72fecf84 Decouple pathname from bottles
Pathname is one of the basic building block classes in Homebrew, and as
such it is preferrable that `require`ing it does not drag in other
Homebrew code; thus avoiding circular dependency situations. Its
dependency on bottles.rb gave it an implicit dependency on formula.rb,
among other things.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-05 20:32:55 -05:00
Jack Nagel
76b2eee777 Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Camillo Lugaresi
a07085df2d use XQuartz when present 2012-07-01 12:10:32 -05: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
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
Jack Nagel
7002359f7a Improve Pathname#text_executable? regexp
file(1) does not allow leading whitespace on shebang lines, and there
appears to be no restrictions on what characters follow '#!', either.

While at it, fix an erroneous shebang test.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-15 20:06:36 -05:00
Adam Vandenberg
0c14036a9a Add ARGV.build_stable? 2012-06-10 14:49:56 -07:00
Jack Nagel
1cce85b1f1 Handle EOF in Pathname#text_executable?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-03 22:34:28 -05:00
Jack Nagel
a786178382 Pathname: add Mach-O module
The MachO module contains methods for learning about Mach-O binaries,
and can be used where one might normally shell out to file(1).

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-30 22:32:48 -05:00
Adam Vandenberg
32ea2e3ad0 Don't unzip war files 2012-05-03 20:40:04 -07:00
Adam Vandenberg
428781723b Detect uncompressed tars
From a patch by @RuiPereira

Closes Homebrew/homebrew#12011.
2012-05-03 20:31:00 -07:00
Charlie Sharpsteen
c9652760ed ENV.rb: Always return integers from make_jobs
When referencing `Hardware.processor_count`, `ENV.make_jobs` will return an
integer. If referencing the environment variable `HOMEBREW_MAKE_JOBS`, it
returned a string.

Now, the function always returns an integer.

Fixes Homebrew/homebrew#12033.
2012-05-03 15:49:27 -07:00
Charlie Sharpsteen
5582ca2548 Revert "ENV.rb: Always return integers from make_jobs"
This reverts commit ea1a9e603abe3dab90bf5b157d2614cf58e2cc8e.

Argh. Unrelated PySide changes slipped in.
2012-05-03 15:48:51 -07:00
Charlie Sharpsteen
52834b8617 ENV.rb: Always return integers from make_jobs
When referencing `Hardware.processor_count`, `ENV.make_jobs` will return an
integer. If referencing the environment variable `HOMEBREW_MAKE_JOBS`, it
returned a string.

Now, the function always returns an integer.

Fixes Homebrew/homebrew#12033.
2012-05-03 15:45:31 -07:00
Adam Vandenberg
3ad19e08b7 Extract detection of compression types
Separate out detecting compression types from uncompressing and staging.
2012-05-02 19:57:33 -07:00
Mike McQuaid
995186a72c Fix Ruby warnings.
Fixes Homebrew/homebrew#11966.
2012-05-01 20:45:17 +08:00
Mike McQuaid
ebe4e07fa3 Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:53:45 +10:00
Mike McQuaid
11f382705c Add and correctly find erlang bottle.
Fixes Homebrew/homebrew#11780.
2012-04-24 18:53:33 +10:00
Mike McQuaid
d69620a55e Revert "Add and correctly find erlang bottle."
This reverts commit 146e253856eb3e27b6b7382734fd178c160c1beb.
2012-04-24 18:10:09 +10:00
Mike McQuaid
4138d30428 Revert "Change versioned bottle syntax and fix issues."
This reverts commit f80908bead8b620ebcc5cdde9de65e70598002b6.
2012-04-24 18:10:08 +10:00
Mike McQuaid
dcad1ae49f Add and correctly find erlang bottle. 2012-04-24 18:08:14 +10:00
Mike McQuaid
40370e05bd Change versioned bottle syntax and fix issues.
Fixed Homebrew/homebrew#11562.
2012-04-24 18:08:14 +10:00
Jack Nagel
9d172f85c6 ARGV: use include? for --HEAD
ARGV.build_head? will return true if the typo '-HEAD' is passed because
it uses flag? to detect the option. However, we only filter the exact
spelling of '--HEAD' in ARGV.filter_for_dependencies, and thus the HEAD
property is undesirably passed to deps during installation.

Since we never advertised '-H' as a valid short option for '--HEAD',
just use include? instead of flag?.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-10 21:53:01 -05:00
Misty De Meo
90400eceb1 make_relative_symlink: give more specific advice 2012-04-09 10:09:19 -05:00
Adam Vandenberg
bfbfdf03eb Show target path when empty 2012-03-30 23:02:43 -07:00
Adam Vandenberg
a0cb4e7c11 install: warn when passed no files
Rationale: we warn when inreplace makes no changes; this is a similar
sort of warning. We expected some list (probably via Dir) to include
some files, but none were found.

Either the list was wrong, or the install can now be omitted.
2012-03-30 22:36:45 -07:00
Max Howell
abfce0f6b2 Don't double print ln message in verbose mode
Refs Homebrew/homebrew#11091.
2012-03-22 09:33:41 +00:00
Jack Nagel
5dc15272d9 ENV: reset LD when switching compilers
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:22:22 -05:00
Jack Nagel
01c14f8775 ENV: normalize usage of "self" and "ENV"
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:22:22 -05:00
Max Howell
d145fd30b4 Be more helpful about how to resolve this issue 2012-03-19 14:19:56 +00:00
Max Howell
9ab1df5b68 If no formula but multiple kegs, advise resolution
In this case the user will simply have to delete all but one keg in order to use the command that uses ARGV.kegs.

Refs Homebrew/homebrew#11050.
2012-03-19 14:17:50 +00:00
Max Howell
c3370c48ce Better error when linking fails
Refs http://stackoverflow.com/questions/9762943

The system ln no longer outputs anything. Though the user can force its output with a --verbose of course. So in cases where it's not the usual of: not writable or existing file, we can ask the user to run with --verbose. I don't particularly like hiding its output, but it just confused the error IMO since it is creating a relative symlink the output was weird every time I've seen it in tickets.

I made a print wrapper so that the brew-link output doesn't get mucked up if an exception is thrown.
2012-03-19 00:28:38 +00:00
Jack Nagel
fe58c056d3 Explicitly set OBJC in the environment
Fixes Homebrew/homebrew#10951.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 16:36:17 -05:00
Max Howell
ee73c30aa5 Tap more than one formula from taps other than alt
Whoops.
2012-03-16 21:31:59 +00:00
Max Howell
4c02b2276b Taps can only have one directory of formula
Rationale: Let's not have duplicate-names. Insisting on only one directory lets the filesystem enforce this unique-naming criteria for us.

We special-case adamv/alt for now, until we remove it.
2012-03-16 21:06:17 +00:00
Max Howell
e6cb8cbee9 Pathname.atomic_write 2012-03-16 21:06:17 +00:00
Max Howell
765ae96180 Leave kegs keg-only if linking step fails
Rationale: well, it should always have been like this!

However now we are opening ourselves up to more-mixed installations of formula not maintained by us, it's important that
2012-03-16 21:06:16 +00:00
Max Howell
0c7e7ae437 brew tap and brew untap 2012-03-16 21:06:15 +00:00
Adam Vandenberg
5aa6aefa96 Allow multiple digits in GitHub version parts 2012-03-11 14:37:44 -07:00
Mike McQuaid
b86ead91ea Revert "Always build bottles universally."
This reverts commit 72a477f2734939d4c5805247588c4cdea69b5383.
2012-03-10 19:28:46 +13:00
Mike McQuaid
6d940a5bcc Always build bottles universally. 2012-03-10 18:11:12 +13:00
Mike McQuaid
552dcdc703 Move most bottle stuff to a bottles.rb file. 2012-03-10 18:10:40 +13:00
Mike McQuaid
4a306f32f4 Support bottles for non-Lion OSX versions. 2012-03-10 18:09:35 +13:00
Charlie Sharpsteen
275d22db9e ENV.rb: Set GCC-style CPU flags for GFortran
GFortran chokes when it is passed CPU flags specific to Clang. This change
ensures the environment variables `FCFLAGS` and `FFLAGS` contain the same CPU
flags that would be set for the GCC compiler.

Fixes Homebrew/homebrew#10424.
Fixes Homebrew/homebrew#10744.

Closes Homebrew/homebrew#10774.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:08 -08:00
Charlie Sharpsteen
55d4f48746 ENV.rb: Generalize method for setting CPU flags
All logic has been copied into a new method `set_cpu_flags` that accepts an
additional argument, `flags`, which contains a list of environment variables
for which the CPU flags are to be adjusted.

`set_cpu_cflags` now recalls `set_cpu_flags` and passes `cflags_flags` as the
first argument.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:05 -08:00
Charlie Sharpsteen
1805e87529 ENV.rb: Modifier methods accept lists of flags
`ENV` methods that modify environment variables, `prepend`, `append` and
`remove`, can now accept lists of flags as well as a single flag.

The list of flags affected by `append_to_cflags` and `remove_from_cflags` are
now definied in a shortcut method `cc_flag_vars`.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:04 -08:00
Max Howell
735b6337a1 If multiple kegs, default to formula keg
If it exists, ARGV.kegs will return the Formula.prefix keg for each rack examined.

So for ARGV=[wget, foo] and the following Cellar (wget/1.11, wget/1.12, foo/1.0) you'll get [wget/1.12, foo/1.0] from ARGV.kegs provided 1.12 is the formula version of wget.
2012-03-07 12:33:47 +00:00