Ruby 1.8.6 doesn't have Symbol#to_proc, which allows things like
map(&:to_s) rather than map { |o| o.to_s }. 1.8.7 does, though, and
since it is used in a bunch of the superenv code we should attempt to
keep it compatible with 1.8.6.
ClosesHomebrew/homebrew#16046.
The option `du -s` is equivalent to `du -d0`. The former is a POSIX standard
(IEEE Std 1003.1-2008), whereas the latter is a BSD extension.
From the BSD man page:
`-s Display an entry for each specified file. (Equivalent to -d 0)`
From SUSv4:
`-s Instead of the default output, report only the total sum for each of the specified files.`
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/du.htmlClosesHomebrew/homebrew#16516.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
* Renames --force to --overwrite, freeing up brew ln --force for Homebrew/homebrew#13349
* Changes --dry-run to preview linking by default, rather than
overwriting. An overwrite dry-run can be simulated via both
--dry-run --overwrite
* Adds some basic Keg tests
ComparableSet only allows a single object of a given class,
choosing the object with the greatest value. This was mainly created
for Requirements, so that, e.g., two X11Dependencies of differing
strictness don't both end up in the same requirement set.
FixesHomebrew/homebrew#15240.
mkpathed directories aren't really "linked" or "unlinked" per se,
and link/unlink handle directories differently. It's easier just to
ignore them, which finally synchronizes link/unlink counts.
Previously we detected this by reading the first line of the file.
However, "first line" is meaningless when dealing with binary files, but
IO#readline will happily keep reading until it finds a newline
character, which can result in some unnecessarily large buffers.
Aside from the performance issue, this causes an additional problem
under Ruby 1.9: trying to match the binary string against a pattern will
raise ArgumentError (unless the binary string just happens to also be
valid UTF-8, heh).
Fix both issues: only read the first 1024 bytes, as no sane shebang will
ever be that long, and use a plain read(), which returns an ASCII
encoded string even on 1.9.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Entry_#copy_metadata has a nasty bug that makes copying symlinks
across filesystems fail. This lasted all the way through 1.9.3p194
before *finally* being fixed. This backports the official fix.
FixesHomebrew/homebrew#14710.
All logs are now stored from each command executed in Formula.install.
Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
We use PKG_CONFIG_LIBDIR to reset the default search path, overriding
whatever is baked into the pkg-config executable. This way, we can later
append XQuartz paths here while still allowing any brewed libs to take
precedence, keg-only or not.
Hopefully this will resolve any remaining issues, and let us get rid of
some per-formula hacks.
c.f. Homebrew/homebrew#14474.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
It has been long enough since `depends_on :x11` was introduced that we
can make it the caller's responsibility to ensure X11 is present before
invoking ENV.x11, so stop outputting a warning.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.
Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.
The previous ENV-system is still available when --env=std is specified.
superenv applies to Xcode >= 4.3 only currently.
This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>