1115 Commits

Author SHA1 Message Date
Mike McQuaid
a5ec0aa259 emoji: extract logic into generic OS classes. (#450) 2016-07-09 13:51:43 +01:00
Martin Afanasjew
6cdc6b1460 Add GitRepositoryExtension
Add an extension for accessing Git-related meta data that can be mixed
in into a Pathname object (e.g. `HOMBREW_REPOSITORY` or the path of a
`Tap` instance). The goal here is to eliminate code duplication.
2016-07-07 01:46:58 +02:00
Martin Afanasjew
ec75ca7e42 extend/os/mac/diagnostic: remove redundant method
Remove an exact duplicate from further up in the same file. (It was
accidentally added in 8a582f2bd976ce7044c3b2dc6eef701f94b9ace5.)
2016-07-06 16:26:27 +02:00
Martin Afanasjew
2842910609 extend/os/mac/diagnostic: fix indentation 2016-07-06 16:22:15 +02:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
Mike McQuaid
11624b9a7d hardware: move generic logic from linux. (#454) 2016-07-06 10:43:54 +01:00
Mike McQuaid
416e51bca9 ENV: only check Superenv if necessary. (#451) 2016-07-06 10:43:42 +01:00
Xu Cheng
cc01d3f59a
doctor: fix undefined method `include?' for nil:NilClass
Closes https://github.com/Homebrew/homebrew-core/issues/2758
2016-07-06 16:18:24 +08:00
Misty De Meo
ca005cb824 doctor: check for beta XQuartz releases
Beta versions of XQuartz have address sanitization enabled, which
breaks some software at runtime, including wine.

Closes Homebrew/homebrew-core#2481.

Closes #459.

Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-07-06 17:21:05 +10:00
Mike McQuaid
59074e91d6 diagnostic: more porting to generic OS. (#449) 2016-07-04 18:35:03 +01:00
Mike McQuaid
fe29cc2920 cleaner: port to generic OS. (#447) 2016-07-04 16:10:24 +01:00
msbit
01e8e180a8 ENV: mark gcc-6 as supporting C++11 (#349)
Add SharedEnvExtension#gcc_with_cxx11_support? to centralise the
logic for checking whether a compiler is known to support C++11.

Update logic to accept GCC 4.8 and above (including 6). Thereby also
address oversight in #163 where support for GCC 6 was added without
updating the C++11 compiler whitelist.

Add tests for Superenv#cxx11.

Closes #346.
2016-06-16 14:15:28 +02:00
Mike McQuaid
fd0a81399b diagnostic: prod unsupported OS users to file PRs. (#365)
They may not but it's nice to be a bit more explicit.
2016-06-14 21:23:56 +01:00
Martin Afanasjew
aa747b915a development_tools: fix broken 'Xcode' reference
Affects only legacy systems that don't have a `/usr/bin/cc` binary.
2016-05-26 19:02:25 +02:00
Mike McQuaid
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Paolo G. Giarrusso
2f20a42292 Synchronize counts for link and unlink (#242)
Closes #239.
2016-05-15 12:07:58 +01:00
Martin Afanasjew
1087df1016 ARGV: fix 'value' method, make it more predictable
The fix changes behavior in same cases, but those cases were all either
broken or showed unexpected behavior. The new behavior is very simple:

- If an argument starts with `--<option-name>=`, return whatever comes
  after the equals sign.

Prior to this change, `ARGV.value` showed some unexpected behavior:

- `ARGV.value("foo")` returned `nil` for `--foo=` because at least one
  character needed to be present after the equals sign. (All other
  option parser implementations I'm aware of allow for empty values.)

- `ARGV.value("bar")` returned `"baz"` for `--foo=--bar=baz` because the
  regular expression was not anchored to the start of the argument.

- `ARGV.value("++")` raised an exception because the string wasn't
  escaped for use in the regular expression. (An unlikely corner case.)

Closes #231.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-12 08:09:19 +02:00
Sebastian Staudt
57bf33302a extend/os/linux/hardware/cpu: fix typo.
CPU was transformed into a class in 8d995e961f549e555f405d2567235dab53f6baad.
2016-05-09 08:41:30 +01:00
Mike McQuaid
9e7b8c61a9 Make config command cross-platform.
Closes #168.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-05-08 16:51:22 +01:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
8d995e961f Make hardware code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
8a582f2bd9 Make diagnostic code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Toru Tanaka
967988c444 Fix a variable name in error message (#190) 2016-05-03 02:24:32 -04:00
Misty De Meo
da643d942e Explicitly list -arch in LDFLAGS on Leopard 2016-04-22 22:37:21 -07:00
Misty De Meo
967fa41e41 Set -faltivec in CFLAGS on Tiger
Setting -mcpu and -mtune on Tiger with gcc-4.2 exposes a bug in one of the
system headers, causing certain builds to fail. This can be fixed by
adding -faltivec to CFLAGS.

See: http://trac.macports.org/ticket/34213
2016-04-22 22:37:21 -07:00
Misty De Meo
2008c880dd Add a helper to determine make path on Tiger 2016-04-22 22:37:21 -07:00
Andrew Janke
258a764f67 stage: fix block signature back-compatibility under Ruby 1.8.7
The new stage() signature introduced by #66 breaks back-compatibility
under Ruby 1.8.7. This fixes it by switching back to a one-argument
block signature and using a new class to wrap both the Resource and
Mktemp info for the staging context, in a signature-back-compatible
way.

Addresses homebrew/homebrew-core#529.

Closes #135.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-22 21:49:00 -04:00
Misty De Meo
35385e8c59 stdenv: stop setting ACLOCAL_PATH 2016-04-21 09:36:30 -07:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Martin Afanasjew
c6536066dc ARGV: remove unused 'usage' method
Also remove related helper method `Homebrew.help_s`.
2016-04-18 00:52:32 +02:00
Andrew Janke
36b2af2e0f superenv: fix formula prefix path to consider revisions
Old logic doesn't include revision. This fixes that, and passes the
whole formula prefix path to avoid duplicating the path-construction
logic.

Closes #80.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 10:41:01 -04:00
Andrew Janke
a8ed06ba74 superenv: allow paths under self's keg
Fixes build error in Homebrew/homebrew-core#100.

Closes #63.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 02:20:17 -04:00
Andrew Janke
343091c828 Merge pull request #27 from apjanke/test-bot-xml-filter
test-bot: revise Step output transcoding and XML character filtering
2016-04-05 17:23:24 -04:00
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