10578 Commits

Author SHA1 Message Date
Dominyk Tiller
36b0666f25
test_gpg: tweak rmtree usage
Swats away this annoying warning when the test is skipped due to GPG being
unavailable:

```
  1) Skipped:
GpgTest#test_create_test_key:
GPG Unavailable

Error:
GpgTest#test_create_test_key:
NoMethodError: undefined method `rmtree' for nil:NilClass
    /usr/local/Library/Homebrew/test/test_gpg.rb:11:in `teardown'
```

Closes #675.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-08-13 03:33:34 +01:00
Dominyk Tiller
13dcdb3098
test_gpg2_requirement: add satisfied test 2016-08-13 03:33:33 +01:00
Dominyk Tiller
e02ad2242a
gpg_requirement: rename to gpg2_requirement 2016-08-13 03:33:33 +01:00
Dominyk Tiller
e62fc26b9c
gpg_requirement: centralise logic in Gpg class
Removes the detection logic from the Requirement in favour of it living inside
the Gpg class & us calling it from there. It's a bit nicer & avoids us calling
Requirement code from outside of direct requirement handling & fulfillment.
2016-08-13 03:33:33 +01:00
Dominyk Tiller
1591633888
gpg_requirement: add standalone requirement
GPG 1.x has stopped receiving new features, some of which we may well want to
take advantage of sooner or later in Homebrew. Upstream has also been attempting
to work out for a while how well used it still is which suggests it may "go away"
at some point in the future.

Debian is also in the process of migrating GnuPG 1.x to a `gpg1` executable
whilst GnuPG 2.1.x assumes the `gpg` executable. There's a detailed video
discussion of this from DebConf 2015 at:
http://meetings-archive.debian.net/pub/debian-meetings/2015/debconf15/GnuPG_in_Debian_report.webm

It's unsafe to assume every `gpg` executable is going to forever equal 1.x and
every `gpg2` executable is going to forever equal 2.x. MacGPG2 has been symlinking
2.x as a vanilla `gpg` for a while, for example, and we will be soon as well.

You'll still be able to plonk the `libexec/bin` path of `gpg` in your PATH to
access a vanilla `gpg` 1.x executable if you want to, but we're not going to
actively keep adding gpg1 support to formulae going forwards. There's really no
reason why 99.9% of projects should not or cannot use `gpg2` these days.

This uses detection methods to determine regardless of what the executable
is called we're always hitting a 2.0 GnuPG or nothing.
2016-08-13 03:33:33 +01:00
Dominyk Tiller
9515e95ae7
requirements: split out gpg 2016-08-13 03:33:33 +01:00
Shaun Jackman
da52fb67f0 install_dependencies: Do not truncate dependencies
See Homebrew/legacy-homebrew#48449
2016-08-12 20:54:18 -04:00
Shaun Jackman
2b847959f0 oh1: Add a truncate option 2016-08-12 20:54:18 -04:00
Dominyk Tiller
2776f08fa0
gpg: simplify available check
which_all already runs some checks to see if the file is a file & is executable.
Our usage here inside `self.available?` is mostly a smoke test.

Closes #676.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-08-12 23:46:43 +01:00
Dominyk Tiller
3005582f15
gpg: combine detection logic 2016-08-12 23:46:42 +01:00
Dominyk Tiller
2c81083f3c
test_gpg: add initial tests 2016-08-12 23:46:42 +01:00
Dominyk Tiller
92a6a557f5
gpg: add initial bare-bones wrapper 2016-08-12 23:46:42 +01:00
Andrea Kao
91b67bd41d tests: add assertion to test_simple_valid_formula 2016-08-12 15:21:27 -07:00
Andrea Kao
967a7a1862 tests: refactor FormulaTextTests in test_cmd_audit 2016-08-12 15:20:22 -07:00
Mike McQuaid
b9efa6336e search: remove thread-unsafe Hash cache.
Doesn't appear to affect the speed of `brew search`.

Fixes #415.
2016-08-12 21:29:49 +01:00
Mike McQuaid
e0c8c00e87 formula_versions: set/unset raise_deprecation_exceptions. 2016-08-12 21:07:03 +01:00
Mike McQuaid
c56625f8b7 utils: check raise deprecation exceptions value. 2016-08-12 21:06:41 +01:00
Mike McQuaid
e091e74c0c global: add Homebrew.raise_deprecation_exceptions 2016-08-12 21:06:00 +01:00
Mike McQuaid
b3ea5c2595 Merge pull request #686 from vladshablinsky/completions
Add completions for --fetch-HEAD flag
2016-08-12 20:25:10 +01:00
Mike McQuaid
24fb0068e7 update: add --force argument.
Add a `brew update --force` to side-step all of the clever optimisations
we have to detect if an update is unnecessary. That means if those
optimisations go wrong in future we can tell people just to run this
single command.

This would have been a useful workaround for the issue fixed in 985c672.
2016-08-12 14:22:00 +01:00
Mike McQuaid
58ffe34bc9 Merge pull request #699 from MikeMcQuaid/update-upstream-branch
update.sh: prevent overwriting UPSTREAM_BRANCH.
2016-08-12 10:24:39 +01:00
William Woodruff
97a66aa513 os/mac: Update ruby-macho calls for compatibility with 0.2.5.
Closes #656.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-08-11 22:34:49 +02:00
William Woodruff
5caa812e2c vendor: Update vendored ruby-macho to 0.2.5. 2016-08-11 22:34:49 +02:00
Mike McQuaid
99837fae47 update.sh: prevent overwriting UPSTREAM_BRANCH.
UPSTREAM_BRANCH was being used both as a loop variable name and name
for the upstream branch for HOMEBREW_REPOSITORY. This meant that the
variable names were overwritten which prevented update.

Closes #693.
2016-08-11 17:22:27 +01:00
Mike McQuaid
d7da1640ff Merge pull request #698 from Homebrew/revert-692-formula_versions_hide_stderr
Revert "formula_versions: also silence stderr."
2016-08-11 17:07:50 +01:00
Mike McQuaid
0a20ceddcc Revert "formula_versions: also silence stderr." 2016-08-11 17:07:31 +01:00
Mike McQuaid
44a80e693a Merge pull request #692 from MikeMcQuaid/formula_versions_hide_stderr
formula_versions: also silence stderr.
2016-08-11 14:27:28 +01:00
Mike McQuaid
0b8eab8dac formula_versions: also silence stderr.
We already stop old formula versions printing stdout but this also stops
them printing on stderr for e.g. old deprecation warnings.
2016-08-11 14:08:37 +01:00
Mike McQuaid
24b5db5367 update.sh: further tweak update fix. 2016-08-11 13:47:13 +01:00
Mike McQuaid
b9d5b11f32 update-test: check we end up at end commit.
This would have caught the bug fixed in 985c67.
2016-08-11 11:26:37 +01:00
Mike McQuaid
985c672bac update.sh: check upstream SHA prefetch not local.
Otherwise this can prevent taps from being updated as expected.
2016-08-11 10:59:35 +01:00
Mike McQuaid
080c4de957 Merge pull request #685 from vladshablinsky/update-man-fetch-head
Update --fetch-HEAD documentation
2016-08-11 08:52:48 +01:00
Vlad Shablinsky
7fa9c0e977 Update --fetch-HEAD documentation 2016-08-11 09:30:59 +02:00
Vlad Shablinsky
b7dc6ce7ee Update zsh-completion for --fetch-HEAD 2016-08-11 09:12:30 +02:00
Vlad Shablinsky
0e0342e18a Add --fetch-HEAD completions to bash 2016-08-11 08:53:06 +02:00
Greg Nisbet
dcc3377aa3 move shell_profile to compat/utils.rb & deprecate 2016-08-10 23:21:30 -07:00
Greg Nisbet
bf63c08d50 tests for shell-specific diagnostic message 2016-08-10 23:21:30 -07:00
Greg Nisbet
f0cc815d86 Multi-shell diagnostic check 2016-08-10 23:21:30 -07:00
Greg Nisbet
f1ce358551 Utils::Shell.shell_profile in formula_cellar_checks 2016-08-10 23:21:30 -07:00
Greg Nisbet
9a29a306cf resolve conflict in diagnostic.rb 2016-08-10 23:19:09 -07:00
Mike McQuaid
4eaa40ae1f Enable vendored Ruby 2.0. 2016-08-10 20:06:14 +01:00
Martin Afanasjew
06fe347de9 os/mac/ruby_keg: improve error reporting
A failure to change a dylib ID or install name would previously cause a
rather cryptic error message, that didn't include the name of the file
that caused the failure, unless `--debug` was specified. Make sure to
output this information in all cases before re-raising the exception.
2016-08-10 17:56:46 +02:00
Mike McQuaid
b6f467b007 Ship Homebrew auto-update support.
Roll this out to everyone (not just developers) and document the
environment variables used for configuration.
2016-08-10 15:46:31 +01:00
Mike McQuaid
0c6e307eef update.sh: all configurable HOMEBREW_AUTO_UPDATE_SECS. 2016-08-10 15:37:04 +01:00
Mike McQuaid
1a240cd52a Tweak HOMEBREW_NO_AUTO_UPDATE handling.
This can just live in `brew.sh` and then it doesn’t need repeated in
all the other places.
2016-08-10 15:37:04 +01:00
Mike McQuaid
11116c2467 update.sh: further speed up brew update.
Tweak the logic further to make the no-op case even faster.

Before:
```
brew update  1.10s user 1.05s system 92% cpu 2.325 total
brew update --preinstall  0.60s user 0.77s system 96% cpu 1.433 total
```

After:
```
brew update  0.60s user 0.34s system 83% cpu 1.132 total
brew update --preinstall  0.29s user 0.24s system 62% cpu 0.860 total
```

These times are now fast enough to avoid any further special-casing for
`--preinstall`, roll it out to users by default and not print a message
unless we've actually found some updates.
2016-08-10 15:37:04 +01:00
Dominyk Tiller
33912e218e
xcode: update expected clang for macOS 10.12 2016-08-10 13:54:19 +01:00
Misty De Meo
fdf55e77e1 Improve formula not found handling (#96) 2016-08-10 10:37:35 +01:00
Mike McQuaid
d0251c1abc formulary: fix to_rack for fully-scoped references
Fixes the case where I have `mysql56` installed but do
`brew uninstall foo/bar/mysql56` which isn't a valid formula.

Fixes https://github.com/Homebrew/legacy-homebrew/issues/39883.
2016-08-10 09:40:39 +01:00
Mike McQuaid
ffd71d02e1 Bottles.md: update documentation.
Fixes #672.
Fixes #673.
2016-08-10 08:38:26 +01:00