752 Commits

Author SHA1 Message Date
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
Xu Cheng
31ca2831f3 Revert "Pathname#version: support bottle version"
This reverts commit 02fba8ce25f1e34c981cb30197e2b4711f88b266.
2015-06-07 23:51:15 +08:00
Xu Cheng
ef7eb0750c Pathname#version: support bottle version
Closes Homebrew/homebrew#40365.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-04 20:05:43 +08:00
Xu Cheng
d2f7a2c410 ARGV#kegs: try to load fomrula from rack 2015-05-27 13:53:40 +08:00
Xu Cheng
60383be032 ARGV: add resolved_formulae method 2015-05-27 13:53:40 +08:00
Ryan Hendrickson
798711cade Use canonical representation of the superenv bin directory
The xcrun script should be skipping the ENV directory when it scans
$PATH looking for tools to run. Unfortunately, the script compares the
paths found to the real path of the ENV directory (following symlinks),
but superenv was adding the nominal path to $PATH, not following
symlinks. As a consequence, platforms with Xcode < 4.3 would get into
infinite loops when trying to call non-system versions of gcc, as xcrun
calls the ENV version of gcc-X.X which calls xcrun and so on forever.

This commit changes superenv to follow symlinks when determining the bin
path to use.

Fixes Homebrew/homebrew#33731.
Closes Homebrew/homebrew#40062.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-25 22:01:12 -04:00
なつき
3649b31765 ENV: Add gcc-5 to compilers support C++11
Closes Homebrew/homebrew#39758.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-16 11:16:55 -04:00
Jack Nagel
bf4dc7449b Clear GOPATH and GOROOT in build environment
Fixes Homebrew/homebrew#37936.
2015-05-14 20:04:45 -04:00
なつき
6181a786c0 compilers: support gcc 5
Closes Homebrew/homebrew#39470.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-08 22:23:30 -04:00