3989 Commits

Author SHA1 Message Date
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
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
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
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
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
3680c4667f man: replace split header/footer with ERB template 2016-04-17 20:43:27 +02:00
Martin Afanasjew
d8e427577d man: pipe markup to 'ronn' to avoid temporary file 2016-04-17 20:43:27 +02:00
Martin Afanasjew
291ff3cc42 man: refactor and fix code style
Split monolithic method into more manageable chunks and fix code style.
2016-04-17 20:43:27 +02:00
Martin Afanasjew
8e42077a8e list: exclude zsh completions from unbrewed
Since edf000e4cd30c3626ccc28c52ed32f2d84a200dd `zsh` completions are in
`share/zsh/site-functions/_brew`, making this path a part of Homebrew.
Hide it from `brew list --unbrewed` to reduce confusion/noise.
2016-04-17 00:13:17 +02:00
Cory Donnelly
bad28dc546 audit.rb: Base desc length check on short name
Currently, brew audit --strict includes the name of the tap when calculating the
length of a formula's description. This makes it difficult to pass the audit for
formulas in taps with lengthy names. In #47033 @jawshooah called out head-only
or devel-only taps specifically, but this is an issue elsewhere. For example:

homebrew/versions/elasticsearch20: Distributed search & analytics engine (72)

This commit updates audit.rb to use formula.name rather than formula.full_name.

Closes #47033 -- Audit shouldn't include tap name in description length
2016-04-16 16:14:15 +02:00
Xu Cheng
a8be17df57 test-bot: update for new deps/uses options
Closes #92.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-16 21:47:47 +08:00
Xu Cheng
7ba9eabc14 uses/deps: default to skip optional/build deps.
Also add options to include optional/build deps and an option
to skip recommended deps.

Closes Homebrew/legacy-homebrew#50066.
2016-04-16 21:47:47 +08:00
Dominyk Tiller
b70e4341fe style: use rubocop 0.39
(#85)
2016-04-14 14:44:23 +01:00
Mike McQuaid
891dcc7c27 update: use official GitHub SHA API. (#75)
This is coming out of preview shortly so use the new API content-type.
2016-04-12 11:12:23 +01:00
Mike McQuaid
0c85113053 Homebrew (opt-in) Analytics tweaks. (#57)
- add `HOMEBREW_PRODUCT` global variable
- only differentiate between `/usr/local` and `non-/usr/local` Homebrew
  prefixes to avoid sharing sensitive user information
- note if e.g. build errors are occurring under CI
- Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out
  when this is enabled for everyone)
- Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics
  that are sent
- Move Bash analytics code to `Library/Homebrew/utils/analytics.sh`
- Add documentation for our analytics and why/what/when/how and opt-out
- Only official Homebrew commands are reported
- Ruby analytics are now reported in a forked, background process
2016-04-12 11:02:22 +01:00
Xu Cheng
c1427fd295 help: support highlighted output
Closes #68.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-12 17:57:18 +08:00
Xu Cheng
af1eb007e2 help: handle alias
Before this fix
```
$ brew --help ls
Error: Unknown command: ls
```

After this fix
```
$ brew --help ls
brew list, ls
<snip>
```
2016-04-12 14:29:49 +08:00
Mike McQuaid
4a7cd160c3 Auto-update when running brew install/upgrade.
Also, slightly tweak the behavior of `brew update` in this case so that
it doesn't print annoying output and still allows the `brew edit` flow
for people with `HOMEBREW_DEVELOPER` set.
2016-04-11 09:31:50 +01:00
Max Nordlund
10edfcd218 Fix documentation error
Closes #10.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-10 22:59:25 +02:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Max Nordlund
b21f699ff2 Implement the brew help command
This is also used by `brew <cmd> --help`. The basic idea is to have the
documentation as a top level comment in each command file. To find these
comments, they have to be like this `#:`.

This is also used by the `brew man` command to keep the documentation
DRY, and for that there are now a header and footer for the man page.
2016-04-10 22:59:24 +02:00
Martin Afanasjew
e747648c53 always prefer HOMEBREW_CURL over plain 'curl' 2016-04-07 08:25:41 +02:00
Andrew Janke
1f8b6cb576 test-bot: add safety margin to output truncation size 2016-04-06 16:48:07 -04:00
Dominyk Tiller
bbb1fcd17c test-bot: stop using --recursive for brew uses
We're not sure this is working as it was intended to, and the primary
end product so far has been making every Ruby 1.8.7 build, which is the Ruby
we use on Mavericks for compatibility, take 5-15 minutes longer per build
than 2.x Rubies.

Cumulatively this is responsible for the vast majority of CI slowness over the
last couple months as Mavericks plays catch-up and everything else waits for it
to do so.

We may revisit this in future, but for now the harm is greater than the "risk".

This technically reverts 7b26c585c2.
2016-04-06 17:57:05 +01:00
Martin Afanasjew
ea38a70395 prune: handle broken app symlinks
Remove broken symlinks from `/Applications` and `~/Applications` that
were previously created by `brew linkapps`, but are no longer valid
because formulae were uninstalled or the provided apps have changed.
2016-04-06 10:31:54 +02:00
Martin Afanasjew
b50e950f0e unlinkapps: add --dry-run option
Add `--dry-run` option as is customary for destructive commands. Update
`bash` completion and man page accordingly. Also correct and update
documentation for both `brew linkapps` and `brew unlinkapps` in more
general terms.
2016-04-06 10:31:54 +02:00
Martin Afanasjew
dcf406f1e4 unlinkapps: modernize
Simplify code by using `Pathname` methods as much as possible. Also
avoid calling external commands for basic functionality like unlinking,
reduce code duplication by using a method from `cmd/linkapps.rb`, count
unlinked symlinks with `ObserverPathnameExtension`, and adjust output
for consistency with `brew linkapps`.
2016-04-06 10:31:54 +02:00
Martin Afanasjew
f63180927c linkapps: modernize
Simplify code by using `Pathname` methods as much as possible. Also
avoid calling external commands for basic functionality like symlink
creation, refactor code that can be shared with `brew unlinkapps`, and
print a summary line at the end (if symlinks were created).
2016-04-06 10:31:54 +02:00
Martin Afanasjew
37b817ed39 test-bot: fix access to relocated method
Fix bug introduced in a2c23dfec569c6e73d90cb20c7d4c26cced258d5. Moving
this method apparently made it inaccessible from `Homebrew::Step`.
2016-04-06 06:35:28 +02:00
Martin Afanasjew
a2c23dfec5 test-bot: fix undefined method error
The method `fix_encoding!` is private to `Homebrew::Step` but is also
required by the `Homebrew.sanitize_output_for_xml` method for truncating
overly long logs. Move `fix_encoding!` into the `Homebrew` module to
make it accessible from both this method and the `Homebrew::Step` class.

This amends commit 343091c828d1e572829b86253d79b326c1986bcd.
2016-04-06 06:22:22 +02:00
Dominyk Tiller
a9c0361a1d audit: require plist_options when using plist
Closes #19.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-04-05 23:57:53 +01:00
Dominyk Tiller
149334d88d audit: check plist placement 2016-04-05 23:57:53 +01: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
fad235d8e8 tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.

The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.

Closes #17.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 07:25:27 -07:00
Dominyk Tiller
20c2cbd98a Revert "test-bot: revise Step output transcoding and XML character filtering"
This reverts commit ceed6636d6986bb2b993ba4680ae484deb76ae29.

```
==> git clean -ffdx
HEAD is now at ceed663 test-bot: revise Step output transcoding and XML character filtering
Removing Library/Homebrew/test/.bundle/
Removing Library/Homebrew/test/fs_leak_log
Removing Library/Homebrew/test/vendor/
Error: invalid regular expression: /[^

 -uD7FFuE000-uFFFDu{10000}-u{10FFFF}]/
```
Using Ruby 1.8.
2016-04-05 05:03:20 +01:00
Andrew Janke
ceed6636d6 test-bot: revise Step output transcoding and XML character filtering
Closes #24.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-04 22:18:17 -04:00
Misty De Meo
f8cdab7d8a Make new keep? superenv logic opt-in
Closes #50425.

Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-04-04 15:30:22 -07:00
Mike McQuaid
77611bafb1 Make Homebrew user agent consistent, use a slash.
Generally it seems user agents are all `software/version` but ours is
not. Also, set the user agent in a way that it's shared between Bash
and Ruby code.

Closes https://github.com/Homebrew/legacy-homebrew/pull/50480.
2016-04-04 12:18:21 +01:00
Xu Cheng
d0b713c396 Revert "lsyncd: use MACOS_FULL_VERSION"
This reverts commit 0f60f76f26ca9fe26e1c10c72905a878a58e3c96.
2016-04-03 23:19:38 +08:00
Xu Cheng
46c25d9833 test-bot: remove update-test 2016-04-03 21:39:59 +08:00
Xu Cheng
e158b5e4b1 pull: fix --legacy for legacy-homebrew repo 2016-04-03 21:22:39 +08:00
Mike McQuaid
276a797d37 Update documentation after repository split. 2016-04-03 14:03:33 +01:00
Xu Cheng
edf000e4cd Core/formula separation Part 2(b)
* move shell completion scripts to where can be auto picked up

Let's use switching new remote as opportunity to put shell completion
scripts to where they should be and avoid git conflict during the process.

* add Library/Formula and Library/Aliases symlinks

Formulae and Aliases has been relocated to homebrew/core tap.
The symlinks are pointed to new location to keep backward compatibility.

* remove formula_renames and tap_migrations

They have been replaced by the json files in the core tap.

* update: set new remote

* bump Homebrew version to 0.9.9
2016-04-03 18:34:17 +08:00
Andrew Janke
e70a3552d3 test-bot: exclude Taps dir from root cleanup 2016-04-03 14:31:12 +08:00
Andrew Janke
6283a274c8 test-bot: have --cleanup clean core repo as well as tested tap
Fixes Homebrew/homebrew#50651
2016-04-03 14:31:12 +08:00
Xu Cheng
232eccc428 test-bot: fix path in cleanup_before
We should remove PR lock files in the test tap rather than HOMEBREW_REPOSITORY.
2016-04-03 14:31:12 +08:00
Xu Cheng
df5bd0b796 pull: fix --legacy when pulling bottle from new repo 2016-04-03 12:15:47 +08:00