1630 Commits

Author SHA1 Message Date
ilovezfs
332c990377 FileUtils::mktemp pass gid to Etc.getgrgid as int
We need to move the Snow Leopard fix down since Etc.getgrgid can't
handle a string.

Closes #31.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 12:24:40 -07:00
Misty De Meo
4fd5c5c159 superenv: filter -I/-L paths on dependencies
Previously, superenv did not try to filter -I or -L flags
based on the list of requested dependencies; as a result, buildsystems
which opportunistically discover Homebrew-installed libraries were able
to link against them even under superenv.

This adds a list of all requested dependencies to the superenv environment,
and compares all -I and -L flags against those; any Cellar and opt paths
found which resolve to unrequested dependencies are filtered out.
2016-04-04 15:30:22 -07:00
Xu Cheng
91fd357c90 Pathname: improve compute_disk_usage
* Count .DS_Store disk usage but not file count.
* Count symlink's own disk usage instead of ignoring it.
* Count hardlinks disk usage only once.
* Add testcase.

Closes Homebrew/homebrew#50563.

Closes Homebrew/homebrew#50566.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-01 16:30:14 +08:00
Xu Cheng
028d155e97 Pathname#version: only parse version from file basename
i.e. Ignoring the file's directory for version parsing.

Closes Homebrew/homebrew#50568.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-31 17:10:22 +08:00
ilovezfs
45e138ffc6 Xcode 7 MACOSX_DEPLOYMENT_TARGET and SDK fixes
SDK 10.10 isn't something that exists for Xcode 7, so stop looking for
it and rely on MACOSX_DEPLOYMENT_TARGET instead.

See PR Homebrew/homebrew#50137 Yosemite build failure

Closes Homebrew/homebrew#50355.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-03-31 13:16:50 +08:00
Xu Cheng
ce7b32cec8 add HOMEBREW_ENV_PATH internal variable
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.

By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
2016-03-21 19:07:38 +08:00
Xu Cheng
bd7e8543b3 deprecate SHA1 2016-03-20 14:55:58 +08:00
Tim D. Smith
fe37cc5271 Revert "Avoid constructing paths by string interpolation"
This reverts commit 8c7f3d859e8f715b6c63e4fe75e7a636aee4167f.
2016-03-19 19:14:50 +08:00
Tim D. Smith
87781f2a37 Avoid constructing paths by string interpolation
Closes Homebrew/homebrew#50154.
2016-03-19 19:14:50 +08:00
ilovezfs
1e1184fc2d superenv: fix make_jobs regular expression
HOMEBREW_MAKE_JOBS can be a multidigit number. The regex should match
the entire number not just the last digit.

Closes Homebrew/homebrew#50016.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2016-03-13 14:32:05 +08:00
Mike McQuaid
0578ba0f42 install_renamed: handle recursive installs.
Closes Homebrew/homebrew#49845.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 13:47:29 +08:00
Xu Cheng
73b79de7bc ARGV: switch? should only has one dash
If user inputs argument such as `-with-flag`, we can assume it's a bad flag.

Closes Homebrew/homebrew#49256

Closes Homebrew/homebrew#49550.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 16:50:55 +08:00
ilovezfs
2517d396aa FileUtils::mktemp fix for OS X 10.6.7 and earlier
FileUtils::fu_get_gid only started doing the conversion of the group
to_s automatically from OS X 10.6.8 (ruby-1.8.7-p358) forward.

OS X 10.6.7 (ruby-1.8.7-p174) would fail in brew's FileUtils::mktemp with the
error "Error: can't convert Fixnum into String."

Fixes Homebrew/homebrew#49045
Fixes Homebrew/homebrew#49348

Closes Homebrew/homebrew#49369.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-21 17:34:19 +00:00
Dominyk Tiller
ff4d16deeb pathname: add append_lines method
* Blocks writing of new files via accidental typos, etc, which the normal open("blah", "a") doesn't.
* Where files don't exist they should ideally be using `(buildpath/"dog").write` instead of open("blah", "a") already.
* It's a bit less cluttered looking if you need several writes to different files in the formula, IMO.
2016-02-21 04:22:23 +00:00
Dominyk Tiller
bfbdfe8d9d env/shared: ignore perl opts
In theory, letting these be set once wasn't an awful idea because it allows
users choice on where Perl modules end up.

In reality, as we've moved closer to sandboxing and at the same time accepted more
perl binding options into formulae it has been exposed as something of a hellraiser.

It's not that uncommon for Perl users to set a custom `INSTALL_BASE` in the ENV which
means we end up with quite a few formula that fail hard with this sort of error:

```
Only one of PREFIX or INSTALL_BASE can be given. Not both.
```

The other common error, which we discovered via sandboxing, is that the Perl modules
end up outside Homebrew's control which means we don't automatically remove them
when the package is removed. Sandboxing blocks this, which means when we eventually
move to enable that by default for users as well as CI it'll quickly become a
prominent issue.
2016-02-20 19:30:31 +00:00
Martin Afanasjew
70ec2a7875 ARGV: stop supporting --homebrew-developer option
Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)

Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.

Closes Homebrew/homebrew#48322.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-02-11 13:15:37 +01:00
Xu Cheng
12a452557d make HOMEBREW_BREW_FILE a Pathname object
Currently HOMEBREW_BREW_FILE is a String, while other of HOMEBREW_*
variables are all Pathname. This commit unifies them all as Pathname,
so it will not cause any confusion.

Closes Homebrew/homebrew#48872.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-06 02:52:48 +08:00
ilovezfs
ca77025f8b Don't accidentally inherit group "wheel" from /tmp
Because files on OS X are assigned the group of the directory in which
they are created, using /tmp during the installation process would
result in some installed files having the group "wheel" even though
"admin" was intended.

Thanks to Xu Cheng for suggesting a simpler location for the fix.

Closes Homebrew/homebrew#45869

Closes Homebrew/homebrew#48732.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-05 21:52:29 +08:00
Dominyk Tiller
abd4c699d1 pathname: remove redundant spacing 2016-01-03 19:08:10 +00:00
Dominyk Tiller
7e7838b5ba pathname: become less introspective
These self references are unnecessary.
2016-01-03 19:07:55 +00:00
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