10755 Commits

Author SHA1 Message Date
Martin Afanasjew
30c0d97e5c readall: stop using no longer needed 'nostdout'
Since switching from `system` to `Utils.popen_read` we no longer need to
suppress Ruby's output of `Syntax OK` to `$stdout`.
2016-04-22 00:47:43 +02:00
Martin Afanasjew
a61829da46 readall: fail on Ruby syntax warnings
Previously, syntax warnings were printed, but didn't cause `readall` to
exit with a non-zero exit code. Now they do, making it easier to catch
accidentally introduced syntax warnings in the test bot.
2016-04-22 00:47:43 +02:00
Logan Rosen
cbc24a715c CONTRIBUTING : fix link to troubleshooting (#133)
The current one returns a 404.
2016-04-21 21:38:10 +01:00
Andrew Janke
4d35dd3fbb doco: "How to PR": do audit while revised formula is installed
Reorders the PR submission steps so `brew audit` is done after `brew install`,
so it can pick up issues with the installed formula, like non-executable stuff
in `bin/`. Matches the `test-bot` process better.

Minor style changes, including consistently using periods at the end of list items
which are complete imperative sentences.

Closes #127.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 15:22:34 -04:00
Andrew Janke
094f6f47dd Formula: include bad value in invalid-option error message
Makes identifying which line in a formula has the bad use of 'option' easier.

Closes #120.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 15:21:44 -04:00
Andrew Janke
a3b70d38a7 brew-audit: pull style checks in to main audit output
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.

Closes #112.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 14:45:33 -04:00
Misty De Meo
534d6fd527 Move OS::Mac::Xcode.provides_autotools? to compat
Closes #125.

Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-04-21 09:36:31 -07:00
Misty De Meo
f5f41f2079 doctor: remove autotools check 2016-04-21 09:36:30 -07:00
Misty De Meo
35385e8c59 stdenv: stop setting ACLOCAL_PATH 2016-04-21 09:36:30 -07:00
Mike McQuaid
00736276fe brew.rb: uninstall old Homebrew Cask. (#121)
This version is never wanted at this point and it will help Homebrew
Cask deal with the annoying errors that result from having this version
still around (some which I've already help users debug).
2016-04-21 16:36:34 +01:00
Mike McQuaid
2671b9f55d analytics: roll tracking ID.
Someone else has been sending weird data to ours and it has bad initial
test data so let's roll it before we ship it to everyone on Saturday.
2016-04-21 08:06:12 +01:00
Martin Afanasjew
b53f0c5ada tests: expand help and help-related tests
Closes #114.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:46:10 +02:00
Martin Afanasjew
d9363a1559 exceptions: add reason to 'UsageError' exception
Use the `reason` attribute to be able to handle `UsageError` subclasses
more uniformly and simplify logic in `brew.rb` to handle them together.
2016-04-20 13:46:10 +02:00
Martin Afanasjew
cf3486f98a help: show command-specific help for invalid usage
Instead of always printing the generic help text, print command-specific
help if it is available and a command raised the `UsageError` exception.
Put the error message underneath the help text (was above) to avoid that
it scrolls off the screen.

Thereby fix a regression where handling the invalid usage would fail to
access `ARGV.usage` removed in c6536066dc39da653d265640c6ba6046bb5def98.
2016-04-20 13:46:10 +02:00
Martin Afanasjew
557ad956fd help: refactor (again) and fix code style issues
Turns out making `empty_argv` a boolean argument for `Homebrew.help` was
not the best idea and having command-to-path mapping and help extraction
in a single method is not flexible enough.

Also only complain about missing help text when `HOMEBREW_DEVELOPER=1`
and otherwise just print the generic help text.
2016-04-20 13:46:10 +02:00
Martin Afanasjew
4f8e3cae5e help: improve styling of generic help text
Format the usage examples more consistently (particularly parentheses
instead of square brackets where one of several alternatives has to be
picked). And add the now much more useful `brew help <command>`.

Closes #113.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:45:26 +02:00
Martin Afanasjew
312fdaa892 --version: move help to documentation comment
This implies that `--version` is treated in most places like a regular
command, e.g. being suggested in shell completion. Also fix the help
text that claimed output goes to standard error, while it actually goes
to standard output.
2016-04-20 13:45:26 +02:00
Martin Afanasjew
76f0479969 --repository: move help to documentation comment 2016-04-20 13:45:26 +02:00
Martin Afanasjew
6931e9421a --prefix: move help to documentation comment 2016-04-20 13:45:26 +02:00
Martin Afanasjew
a3352c000e --env: move help to documentation comment 2016-04-20 13:45:26 +02:00
Martin Afanasjew
046b481806 --cellar: move help to documentation comment 2016-04-20 13:45:26 +02:00
Martin Afanasjew
bab823288f --cache: move help to documentation comment 2016-04-20 13:45:26 +02:00
Martin Afanasjew
d29d58b3fb man: put option-style commands after regular ones 2016-04-20 13:45:26 +02:00
Martin Afanasjew
d183ff8065 tests: fix Ruby 1.8 syntax warnings
In `Library/Homebrew/test/`:

test_integration_cmds.rb:431: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:502: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:507: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:585: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:709: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:710: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:711: warning: (...) interpreted as grouped expression
2016-04-20 01:42:14 +02:00
Martin Afanasjew
980001341d brew.rb: fix Ruby syntax warning
Library/brew.rb:108: warning: `*' interpreted as argument prefix
2016-04-20 01:38:00 +02:00
Xu Cheng
0949a6955a man: fix Ruby syntax warning
Library/Homebrew/cmd/man.rb:44: warning: assigned but unused variable - commands

Closes #116.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-19 22:44:38 +08:00
Xu Cheng
799d3aec15 test-bot: simplify the logic
Closes #115.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-19 16:29:29 +08:00
Xu Cheng
9a6d5a4fee add Tap#default_remote
* without `default_remote`, `CoreTap#install` won't be able to tell
  whether user has passed to custom remote to it.
* simplify some part of logics
2016-04-19 16:29:29 +08:00
Xu Cheng
71b6e0aa18 Tap#install: better TapRemoteMismatchError check
* remote check requires `git` installed.
* Do not perform check if user does not passing remote explicitly.

Fixes #108
2016-04-19 16:29:29 +08:00
Xu Cheng
9b79f45e94 Revert "man: fix Ruby syntax warning"
This reverts commit 2caf7b76bb3e09ffabf8c56d3934ba8190673fdc.
2016-04-19 15:25:44 +08:00
Xu Cheng
612f70fba1 linkage: fix Ruby syntax warning
Library/Homebrew/dev-cmd/linkage.rb:113: warning: shadowing outer local variable - label
2016-04-19 15:08:38 +08:00
Xu Cheng
2caf7b76bb man: fix Ruby syntax warning
Library/Homebrew/cmd/man.rb:44: warning: assigned but unused variable - commands
2016-04-19 15:08:34 +08:00
Xu Cheng
5d1e648194 test-bot: prevent infinite loop caused by unavailable formula.
Noted, `brew tap foo` will not fail if the tap is already installed.
2016-04-19 14:21:42 +08:00
Xu Cheng
684c44f356 linkage: load formula from rack
This is to avoid TapFormulaAmbiguityError.
We should load formula based on what we installed,
rather than just name.
2016-04-19 13:55:47 +08:00
Andrew Janke
da34fba151 test-bot: check all dependents for broken dylibs
Pulls 'brew linkage' in to main brew repo as a dev-cmd, and has test-bot
use it to detect dylib breakage, which usually means a revision bump is
needed. Checks all dependents, not just those with a 'test do' block
defined, since we can do this without formula support.

Closes #107.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 13:37:34 -04:00
Dominyk Tiller
c3c233dd80 test-bot: don't untap during cleanup_before 2016-04-18 17:54:41 +01:00
Misty De Meo
75f1e49027 CLT: special case detect_version pre-3.x
Fixes mistydemeo/tigerbrew#186.

Closes #110.

Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-04-18 09:52:46 -07:00
Misty De Meo
19fba42c69 Xcode: update version detection for 2.x 2016-04-18 09:52:46 -07:00
Misty De Meo
a1a81daffc XQuartz: detect Tiger's prefix 2016-04-18 09:52:46 -07:00
Misty De Meo
880ba0c952 XQuartz: add Tiger's version 2016-04-18 09:52:46 -07:00
Misty De Meo
eb9e68817d XQuartz: support Tiger's prefix 2016-04-18 09:52:46 -07:00
Dominyk Tiller
46cfc9826c test-bot: purge non-core taps at start/end of job (#109)
e70a3552d3 seems to have
exacerbated the problem where taps stick around and then `brew uses` gets executed
on a whole host of taps, which is currently breaking almost every PR for formulae
that would be used cross-tap, as well as causing lengthier CI builds.

Examples from the last week or so include sqlite, V8, protobuf, and so on. Whilst it
may be true that cross-tap formulae failing can show problems that need looking at,
a lot of the time the failures are unrelated to the build in question and just
leave contributors confused on what needs to be done, or why their PR is failing
for something that seems entirely unrelated.

You can see the taps failing to vanish locally by doing something like:

```
brew tap homebrew/fuse
brew tap homebrew/versions
cd $(brew --prefix) && git clean -ffdx --exclude=/Library/Taps/
brew tap
...
homebrew/core
homebrew/fuse
homebrew/versions
```

This is a very simple proposal to handle the problem, but there's no real reason
I couldn't write this functionality into untap itself and then we call that in
test-bot. Just didn't necessarily want to jump immediately to expanding the untap
command to solve what is more-or-less a CI problem.
2016-04-18 17:39:52 +01: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
Mike McQuaid
0e8140b012 brew.sh: error out if no Ruby found.
This is a nicer error message than the `exec` failing at a later stage.
2016-04-18 15:16:43 +01:00
Martin Afanasjew
f15b631875 brew.rb: don't show help for 'brew <command> help'
Showing help makes sense for `brew help <command>`, but showing it for
`brew <command> help` is undesirable and prevents all commands from
accepting a named argument `help` (formula, tap, file name, etc.).

All other help flags are still detected before *and* after the command.

Closes #103.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-18 00:52:33 +02: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
Martin Afanasjew
3503806e77 help: handle help output (move from 'brew.rb')
Keep the footprint of `brew.rb` small. Handle fetching/displaying an
appropriate help text (taking into account various external conditions)
in the `help` command.
2016-04-18 00:52:32 +02:00
Martin Afanasjew
144d86f733 tests: test FormulaClassUnavailableError
Closes #101.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-17 21:16:01 +02:00
Martin Afanasjew
94a627d7aa install: handle FormulaClassUnavailableError
Don't search for alternatives if formula was found, but has issues, as
this will create confusing output, particularly for contributors working
on a formula file.
2016-04-17 21:16:01 +02:00
Martin Afanasjew
c3076f0b69 formulary: use FormulaClassUnavailableError
Present a more helpful error message if a formula file was loaded, but
the class(es) therein didn't match the expected formula class name.
2016-04-17 21:16:01 +02:00