Commit Graph
223 Commits
Author SHA1 Message Date
Jack Nagel b7a4bc644a 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 31394247e4 make_relative_symlink: give more specific advice 2012-04-09 10:09:19 -05:00
Adam Vandenberg ef416878d5 Show target path when empty 2012-03-30 23:02:43 -07:00
Adam Vandenberg 423a8c34fe 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 45d9bb28ec Don't double print ln message in verbose mode
Refs #11091.
2012-03-22 09:33:41 +00:00
Jack Nagel d82bfafa79 ENV: reset LD when switching compilers
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:22:22 -05:00
Jack Nagel f34e48c35c 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 109c5eb88b Be more helpful about how to resolve this issue 2012-03-19 14:19:56 +00:00
Max Howell 14fc553ac7 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 #11050.
2012-03-19 14:17:50 +00:00
Max Howell ce082c167c 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 016c87d06d Explicitly set OBJC in the environment
Fixes #10951.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 16:36:17 -05:00
Max Howell 6892247ce1 Tap more than one formula from taps other than alt
Whoops.
2012-03-16 21:31:59 +00:00
Max Howell e613cbe578 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 fa215d34e9 Pathname.atomic_write 2012-03-16 21:06:17 +00:00
Max Howell 635ce6f5e7 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 fb13b6a99e brew tap and brew untap 2012-03-16 21:06:15 +00:00
Adam Vandenberg f12ba4d75c Allow multiple digits in GitHub version parts 2012-03-11 14:37:44 -07:00
Mike McQuaid 1ac6371685 Revert "Always build bottles universally."
This reverts commit 72a477f273.
2012-03-10 19:28:46 +13:00
Mike McQuaid 72a477f273 Always build bottles universally. 2012-03-10 18:11:12 +13:00
Mike McQuaid 28b8cc7ee6 Move most bottle stuff to a bottles.rb file. 2012-03-10 18:10:40 +13:00
Mike McQuaid 24476086ae Support bottles for non-Lion OSX versions. 2012-03-10 18:09:35 +13:00
Charlie Sharpsteen 0f467bbcc9 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 #10424.
Fixes #10744.

Closes #10774.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:08 -08:00
Charlie Sharpsteen 295116ff72 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 6e3726c730 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 1e4c65be0b 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
Jack Nagel 38fffe732f Extend FileUtils rather than include it
Fixes #10729.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-06 19:23:51 -06:00
Max Howell 1cdad6f201 Pathname.stem knows about bottles 2012-03-06 20:28:06 +00:00
Max Howell 03b2aae0a8 Proper single character switch handling
Includes a test. So now you can do `brew cleanup -ns` and it will work.
2012-03-06 20:28:06 +00:00
Max Howell a42301ecf6 Don't require formula files for brew rm --force
In fixing this I also made it so that ARGV.kegs will return the LinkedKeg if the symlink is set. Which is almost always is. This neatly avoids most multiple-kegs issues.

Fixes #10685.
2012-03-06 13:47:31 +00:00
Adam Vandenberg fcb33f7c54 Move path utils out of formula.rb
Make a new module for our FileUtils extensions and use that instead.
2012-03-05 21:14:39 -08:00
Max Howell 56125019d7 Set ACLOCAL_PATH so that things work
This should mean all those formula that pass options to aclocal don't need to anymore, but I'm not risking changing them.
2012-02-27 04:06:39 +00:00
Jack Nagel 8d307119bd Fix IO redirection in ENV.xcrun
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-26 15:01:01 -06:00
Adam Vandenberg 9659468ed3 inreplace: also warn on plain gsub! usage 2012-02-25 22:41:20 -06:00
Jack Nagel dbde261512 inreplace: warn if no substitutions were made
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-25 22:37:29 -06:00
Charlie Sharpsteen ab7067c9af ENV.rb: Set flags for Objective-C
We set defaults for C and C++, might as well do the same for Objective-C and
Objective-C++.

Closes #10354.
2012-02-21 21:34:48 -08:00
Max Howell c1911f7ae2 Convert to Pathname if not Pathname as we need it to be 2012-02-21 12:45:45 +00:00
Max Howell 6b2340fd92 Don't hang if xcode-select -print-path is "/"
Introducing MacOS.xctools_fucked?.

Refs #10293.
2012-02-21 10:33:03 +00:00
Jack Nagel 8ee2a1d8b0 Remove -Qunused-arguments in ENV.enable_warnings
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:41:47 -06:00
Jack Nagel 3709168a71 Remove unused :force switches
The :force behavior for ENV.gcc has been the default for some time, and
was used to force vanilla gcc in case the gcc symlink pointed at
llvm-gcc; for ENV.clang, this doesn't mattera as clang is just clang.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:22:27 -06:00
Jack Nagel b1f5faea0a Silence unused argument warnings from clang
The clang frontend ignores a number of options that are accepted by gcc
and llvm-gcc. However, it produces a warning for each unused argument at
each invocation, which can result in many lines of noise, e.g.

   clang: warning: argument unused during compilation: '-rdynamic'

Since these arguments do not affect compilation, let's just silence the
warnings by passing '-Qunused-arguments' to clang by default.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:22:17 -06:00
Jack Nagel 3d3d7c6c88 ENV: clean up set_cpu_cflags a bit
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:20:29 -06:00
Camillo Lugaresi 5ae547ad79 add ENV.O1
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-19 11:45:15 -08:00
Adam Vandenberg 4e9c4e3872 Update return values of install and install_symlink
These now return an Array of all the target destinations.
Previously, if a single argument was passed a single non-
Array was returned.

This behavior has been changed so that an Array is always returned
even for a single argument.

Updated the test.

Hopefully this won't break any custom code out there.
2012-02-17 23:07:16 -08:00
Adam Vandenberg 06328a026c This should be a regex 2012-02-17 19:43:44 -08:00
Max Howell c98549bde1 OTT handling for various Xcode-4.3/CLI-Tools edge cases
Also xcrun can only exist at /usr/bin/xcrun.

Most of these edges are non-buildable environments, but I didn't know that when writing it, so it may as well stay, since it still does make brew --env more correct.
2012-02-18 01:53:55 +00:00
Max Howell 17af67977e Find xcrun if user doesn't ever install Xcode 4.3 helper tools 2012-02-17 13:34:06 +00:00
Max Howell 6caf32a8e5 Work with Xcode 4.3 if user didn't install helper tools
We ask Spotlight to find Xcode and use that path, neat right?
2012-02-17 13:08:55 +00:00
Max Howell ab0e0a3023 Use xcrun; Ensure clang is the default compiler with Xcode 4.3
Using xcrun as a proxy to execute the compiler tools is per its design. This means you can't treat ENV['CC'] as a path anymore, but I think I found the cases this was being expected and corrected them. It was not proper anyway to assume the variable was a path, it can be anything. Like a proxy. Like xcrun.

Also more thoroughly clear ENV.
2012-02-16 23:43:43 +00:00
Jack Nagel da39879b25 Unset CLICOLOR_FORCE in the build environment
If we're going to unset GREP_OPTIONS we may as well unset this one too,
as it causes similar issues. Recent autoconf unset both of these.

Fixes #8165.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-16 16:55:28 -06:00
Max Howell 2fab16ea93 Find the dev tools, even with Xcode 4.3
Fixes #9179.
2012-02-16 18:19:01 +00:00