654 Commits

Author SHA1 Message Date
Mike McQuaid
58cb4444da etc.install: handle recursive directory installs.
We need to install the helper module not just on `etc` but also on all
subdirectories of it too. Also, handle the case where we install
a subdirectory with etc.install.

Closes Homebrew/homebrew#26145.
2014-08-26 08:30:47 +01:00
Jack Nagel
b0c1e5f7d6 Fix redefinition of x11 reader method in superenv 2014-08-24 14:32:10 -05:00
Jack Nagel
00220c40db Don't overwrite optimization flag map in ENV.clang 2014-08-18 16:02:53 -05:00
xxxajk
1dc384b4c4 Fix mktmp to be generic as-per SUS/BSD.
Closes Homebrew/homebrew#31586.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-08-14 10:36:07 +01:00
Jack Nagel
e0f86a1a86 Pull effective arch detection into a method 2014-08-09 14:57:09 -05:00
Jack Nagel
9f6bd0798f Use opt_bin 2014-08-06 20:52:36 -05:00
Jack Nagel
5a2ae61e66 Add another TODO 2014-08-03 15:28:51 -05:00
Jack Nagel
fded4d0385 Remove an is_a check 2014-08-03 10:47:47 -05:00
Adam Vandenberg
fbee511eba Pathname.binread 2014-07-29 07:25:27 -07:00
Adam Vandenberg
5af3d319d6 backport binwrite from Ruby 2.1+ 2014-07-27 16:21:35 -07:00
Adam Vandenberg
8e96ce0aa5 Rename write_binary to binwrite 2014-07-27 15:30:46 -07:00
Adam Vandenberg
10e5fea01d add Pathname.write_binary 2014-07-27 11:14:51 -07:00
Jack Nagel
a5895ad1fe Check nil? || empty? instead of to_s.empty? 2014-07-18 11:43:37 -05:00
Jack Nagel
3439703c65 Drop pointless to_s call 2014-07-18 11:43:37 -05:00
Phillip Calvin
d4b6d8ec96 Remove commentary from error message
It might be best not to use the word "lame" here, as it's often considered to be an ableist slur.

Closes Homebrew/homebrew#30915.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-17 12:11:57 -05:00
Adam Vandenberg
12fe7e2771 nudge formatting
Needed for Emacs' ruby highlighting to work past this point in the file.
2014-07-13 12:04:45 -07:00
Jack Nagel
fe0c018a1a No need to cache lookup that is only done once 2014-07-13 10:50:56 -05:00
Jack Nagel
c259866517 Raise Errno::ENOENT instead of RuntimeError from Pathname#install 2014-07-10 22:00:43 -05:00
Jack Nagel
284389a6bd Make comment in Pathname#install more accurate 2014-07-10 15:39:55 -05:00
Jack Nagel
cf4080a9e0 Remove a RUBY_VERSION check, add a FIXME comment 2014-07-05 16:01:09 -05:00
Camillo Lugaresi
4001c6f8f1 stop Xcode tools from overriding deps when CLT is not installed
Closes Homebrew/homebrew#30641.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-03 16:25:59 -05:00
Jack Nagel
618b894c3e Replace ComparableSet with a Requirements collection 2014-07-03 14:50:57 -05:00
Jack Nagel
ef9f6ec4af Accept -s as shorthand for --build-from-source
This is experimental and will be reverted if it causes problems.

Closes Homebrew/homebrew#30392.
2014-07-02 23:15:22 -05:00
Jack Nagel
32d84377d5 Move constants so we don't have to load all of ENV to get them 2014-07-02 21:58:43 -05:00
Jack Nagel
177eee419a Replace find_all + each with grep 2014-07-01 21:39:15 -05:00
Jack Nagel
70f22fc31e Use canonical_name in the exception message 2014-06-26 22:59:45 -05:00
Jack Nagel
cfd02fd415 Use canonical_name when checking LinkedKegs and opt
name is the user-provided string and may be an alias, path, or URL.
2014-06-26 22:57:49 -05:00
Jack Nagel
401bc1c6c7 The rack variable is only used inside the block now 2014-06-26 22:36:49 -05:00
Jack Nagel
301f1b20e6 Remove a dead branch from ARGV.kegs
rack cannot be nil at the point where FormulaUnavailableError is raised,
so we don't need a branch to deal with that.
2014-06-26 22:28:00 -05:00
Jack Nagel
dce7b04ea5 Simplify NoSuchKegError condition
dirs will be empty if the rack directory does not exist.
2014-06-26 22:26:13 -05:00
Jack Nagel
20d544085a Use a more descriptive variable name 2014-06-22 18:43:14 -05:00
Jack Nagel
0fda322e0e Use Pathname#split 2014-06-22 18:38:30 -05:00
Shaun Jackman
42c20b0979 Move the compiler-selecting methods to ENV/shared
Closes Homebrew/homebrew#30210.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-22 18:30:15 -05:00
Jack Nagel
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Jack Nagel
445dd80e44 Remove ARGV.filter_for_dependencies 2014-06-20 21:32:36 -05:00
Jack Nagel
10fda9e9b9 Decouple spec selection from ARGV 2014-06-20 21:32:36 -05:00
Jack Nagel
c73baa39cb Add explicit mkpath to Pathname#write_env_script 2014-06-17 21:51:45 -05:00
Jack Nagel
5cbc5437f5 Add explicit mkpath to Pathname#write_jar_script 2014-06-17 21:51:45 -05:00
Jack Nagel
d96f15e324 Add explicit mkpath to Pathname#write_exec_script 2014-06-17 21:51:45 -05:00
Jack Nagel
b2c42fc63c Make signature of Pathname#write compatible with Ruby 2.1+ 2014-06-17 12:14:51 -05:00
Jack Nagel
96195295a3 Deprecate Pathname#cp and Pathname#chmod_R
As far as I can tell these methods have only ever been used in the test
suite.

Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.

Closes Homebrew/homebrew#30081.
2014-06-12 09:00:58 -05:00
Jack Nagel
faaa622820 Deprecate Pathname#/ with non-string/non-pathname arguments
Ruby 2.2 will define Pathname#/ as a simple alias of Pathname#+.
In practice, this means that it will raise a TypeError unless the
argument responds to to_path or to_str.

Currently we blindly convert the argument to a string using to_s, so
deprecate this in the interest of matching the upstream behavior. In the
future we can replace this with

  alias_method :/, :+ unless method_defined?(:/)

Closes Homebrew/homebrew#30079.
2014-06-12 09:00:51 -05:00
Jack Nagel
93d8e71641 Use Digest#file if it's available 2014-06-11 12:05:19 -05:00
Jack Nagel
191e588212 Stop caching Superenv.bin
It is not a hotspot and causes an ordering dependency in the tests.
2014-06-10 17:50:33 -05:00
Jack Nagel
7f10aa3b6e Fix visibility of FileUtils extension methods 2014-06-09 21:37:52 -05:00
Jack Nagel
9e57da83a2 Stop exposing mktemp as a public method on formula objects 2014-06-09 21:36:36 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
fb3f95923b Just access the ivar directly 2014-06-08 20:04:16 -05:00
Jack Nagel
d27dc1d02f Work around encoding issue in Pathname#inspect on Ruby 2.0
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's
underlying string and returns a string tagged as ASCII-8BIT.

If you simply write

  puts Pathname.new("some string with non-ascii bytes").inspect

no error will be raised, because the implementation of Pathname#inspect
does not call into Object#inspect.

However, if you wrap that pathname object in an array first, then

  puts [Pathname.new("some string with non-ascii bytes")].inspect

will raise Encoding::CompatibilityError: "inspected result must be ASCII
only or use the same encoding with default external".

Raising an error in this codepath is new in Ruby 2.0, and this specific
bug is fixed in Ruby 2.1. I've opened a bug upstream:
  https://bugs.ruby-lang.org/issues/9915

Fixes Homebrew/homebrew#29947.
2014-06-08 20:00:52 -05:00
Jack Nagel
6d0f0cb195 metafiles: simplify #copy? further 2014-06-07 23:40:28 -05:00