760 Commits

Author SHA1 Message Date
Mike McQuaid
0bca7ad9c3 pathname: don't try to calculate symlink size.
Closes https://github.com/Homebrew/homebrew/issues/47532
Closes https://github.com/Homebrew/homebrew-dupes/issues/542
2015-12-30 19:46:23 +00:00
Xu Cheng
24224dc896 pathname: improve compute_disk_usage
* Avoid parallel assignment.
* Use Pathname#size instead of File#size
* Use Pathname#directory? instead of File#directory?
* Use basename to check `.DS_Store`. Original regex has poor
  performance, and may match with incorrect file.
2015-12-30 16:27:15 +08:00
Mike McQuaid
482481d24c pathname: fix use of find on Ruby 1.8. 2015-12-30 08:23:57 +00:00
Rakesh
e4f2a1e0ef pathname: store file count and disk usage.
especially for directory instances of `Pathname` class and all
instances of `Keg` class.
2015-12-30 08:11:23 +00:00
Martin Afanasjew
8e4fad8969 ENV: avoid misleading Fortran setup warnings
Fixes Homebrew/homebrew#31156.
Closes Homebrew/homebrew#47246.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-23 06:54:04 +01:00
Dominyk Tiller
b331e03c39 env: add java_cache env 2015-12-18 23:32:56 +00:00
Ryan Hendrickson
8ce81af67a ENV: warn_if_universal_binaries_not_supported
Raise an error when attempting to create universal binaries with a GCC
that can't do so.

Closes Homebrew/homebrew#46630.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-10 11:23:11 +01:00
Misty De Meo
5ecf3113a8 superenv: set SDKROOT, MACOSX_DEPLOYMENT_TARGET 2015-12-07 13:17:43 -08:00
Xu Cheng
9755662e49 add String#strip_prefix 2015-12-03 13:46:58 +08:00
Xu Cheng
3a68b915eb Stdenv: add note on possible future deprecation
Closes Homebrew/homebrew#46043.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-17 18:52:00 +08:00
Xu Cheng
d108bf0a55 move more deprecated methods to compat folder 2015-11-17 18:52:00 +08:00
Xu Cheng
baf3ca09b2 Stdenv should be tagged as private rather deprecated 2015-11-17 18:52:00 +08:00
Mike McQuaid
307ca85e0e ARGV: add explicit option for disabling sandbox. 2015-11-10 09:09:03 +00:00
Xu Cheng
646f94adfe move mach.rb to os/mac/mach.rb 2015-10-18 22:57:42 +08:00
Xu Cheng
06806f860d remove unnecessary require statements 2015-10-18 22:57:42 +08:00
Xu Cheng
235c5b6bfa ObserverPathnameExtension: only puts first 100 operations
Fixes https://github.com/Homebrew/homebrew/issues/44320#issuecomment-143951973

Closes Homebrew/homebrew#44440.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-08 16:12:01 +08:00
Xu Cheng
767d961824 ENV#userpaths!: ensure Superenv.bin and opt path come at first
This ensures that binaries in /usr/local/bin would not overwrite
superenv.

Closes Homebrew/homebrew#44376.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-28 21:47:04 +08:00
Misty De Meo
3bc2ff8e20 Accept "gcc" for --cc=gcc-5 even if not installed 2015-09-12 11:47:14 -07:00
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
William Woodruff
b0d5e17906 tweak String#undent so that only leading whitespace up to the first indentation level is gsubbed, change test_undent to reflect change and add test_undent_nested to test new behavior 2015-08-28 18:02:04 +08:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
8793a68ee4 Add no-Xcode documentation for all classes, methods 2015-08-21 11:02:33 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
Tim D. Smith
6606c7b53b Revert "work around missing __debug header in Xcode CLT 6.3"
Ding, dong, the witch is dead...

This reverts commit fd5ca9ba16f5afc181364369210cb94e997a5a5e.

Ref Homebrew/homebrew#38514, Homebrew/homebrew#38735.

Closes Homebrew/homebrew#41843.
2015-08-15 20:24:20 -07:00
Xu Cheng
e1779503b7 ARGV#resolved_formula: use to_rack 2015-08-10 21:59:50 +08:00
Vlad Shablinsky
6a0dcc8324 don't use new name rack if old name rack is a dir
Everything that used HOMEBREW_CELLAR/canonical_name
could point to something that doesn't exist because
loader_for tries to load new name formula if no old
name found. However there can be software installed
from path with the same name that renamed formulae
had and we still need to link/unlink/uninstall etc
that software. The solution is Formulary#to_rack
method that returns rack for given name.
- Add Formulary#to_rack
- Update ARGV.kegs
- Update cmd/switch
2015-08-10 13:57:59 +01:00
CNA-Bld
194618beb8 implement formulary#find_with_priority 2015-08-10 12:17:26 +01:00
Xu Cheng
df999067d6 ARGV#resolved_formulae: use canonical_name to locate rack
Closes Homebrew/homebrew#42537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:09:57 +08:00
Xu Cheng
7c72b0c68a backport flat_map for Ruby 1.8
Code is copied from
https://github.com/marcandre/backports/blob/master/lib/backports/1.9.2/enumerable/flat_map.rb
(MIT License by Marc-Andre Lafortune)

Closes Homebrew/homebrew#42543.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-06 22:33:46 +08:00
Xu Cheng
ae0e270727 favor flat_map over map...flatten 2015-08-06 22:33:46 +08:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08:00
Misty De Meo
176e55386c ARGV: don't downcase bottle filenames
Fixes Homebrew/homebrew#42470.
2015-08-05 09:51:37 -07:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
640109f73d ARGV#resolved_formulae: auto resolve spec 2015-07-31 19:44:03 +08:00
Xu Cheng
773db6a3ba ARGV#spec: allow pass default value 2015-07-31 19:44:02 +08:00
Xu Cheng
fd7f3b9496 Pathname#abv: handle the case du returns empty string
This can happen when read permission is denied.

Fixes Homebrew/homebrew#41925.

Closes Homebrew/homebrew#42011.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-22 20:35:01 +08:00
Jack Nagel
5e7edbbd3c Ask the exception for the formula name 2015-06-22 21:08:27 -04:00
Jack Nagel
87e7735012 Ask the formula object for the opt path 2015-06-22 21:00:40 -04:00
Jack Nagel
f1bf81dd55 Simplify gcc_version_formula 2015-06-21 21:18:24 -04:00
Jack Nagel
1ce04786d6 Inline variable 2015-06-21 21:18:24 -04:00
Jack Nagel
3f11f1a0de Eliminate special case for core gcc 2015-06-21 21:18:24 -04:00
Jack Nagel
2db59be452 Less code in begin/rescue block 2015-06-21 21:18:23 -04:00
Jack Nagel
1bba5fd88a Pass full match to warn_about_non_apple_gcc 2015-06-21 21:18:23 -04:00
Jack Nagel
ec1727a1be Remove backports for Ruby 1.8.6
refs. Homebrew/linuxbrew#438, mistydemeo/tigerbrew#327,
mistydemeo/tigerbrew#334
2015-06-19 22:20:47 -04:00
Jack Nagel
09f8c54f83 Move some constants from env to compiler constants 2015-06-19 21:38:39 -04:00
Jack Nagel
7edf3c88f6 Pass formula objects, not strings, into the build environment 2015-06-18 23:13:48 -04:00
Jack Nagel
aad4ed7faa Undocument return value of ENV.deparallelize
It's not clear whether it returns MAKEFLAGS with or without -j<n>, and
neither is particularly useful behavior, given you can easily get the
exact value by calling ENV["MAKEFLAGS"]. So let's not commit to this
API.
2015-06-12 20:14:07 -04:00
Xu Cheng
f2d0a88292 remove Pathname#find_formula
Closes Homebrew/homebrew#40486.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-11 15:28:30 +08:00