aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-04-10Implement the `brew help` commandMax Nordlund
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-10xcode: expect 7.3 on 10.11Dominyk Tiller
xcode: expect 7.3 on 10.11
2016-04-09Remove advice on bad Python linkingTim D. Smith
This is pathological and something that should be fixed in core, not by working around it. Closes https://github.com/Homebrew/legacy-homebrew/pull/45704.
2016-04-09diagnostic: fix style of previously skipped methodMartin Afanasjew
Fix style of previously omitted `check_for_bad_install_name_tool` method to be in line with changes made in #49. Closes #56. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-09Revert "diagnostic: improve check for 'install_name_tool'"Martin Afanasjew
This reverts commit 9f79c05656a44f926898774c6029025002bcd621. Restore check to continue to inspect `/usr/bin/install_name_tool`. See Homebrew/legacy-homebrew#50091 and Homebrew/legacy-homebrew#50509 for the full context and more details.
2016-04-08diagnostic: prefer guard clauses for readabilityMartin Afanasjew
Guard clauses instead of if/unless blocks make the checks easier to understand and reduce nesting, thus improving overall readability. This includes the following additional minor changes: - Make indentation of commands consistent inside diagnostic messages. - Fix minor typos and inconsistent punctuation in diagnostic messages. - Fix here documents to always start with `<<-EOS.undent` on a new line, followed by the message (indented once), followed by `EOS` (at the same level like `<<-EOS.undent`). - Always separate the check logic (and guard clauses) from the following message by a single empty line (for consistency and readability). - Standardize on `message` as the variable name when diagnostic messages need to be constructed from multiple parts. - Where easily possible, adapt check logic to stay within 80-column limit, use more expressive variable names, and break down long expressions into multiple statements with intermediate results. Closes #49. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-08brew.sh: make sure to always use system 'awk'Martin Afanasjew
This should prevent issues like #47 and make us more resilient.
2016-04-08scm/git: prevent exec bomb with 'env :userpaths'Martin Afanasjew
Using `git` from `Formula#install` can cause an exec bomb if used in a formula with `env :userpaths` because that causes both `Library/ENV/4.3` and `Library/ENV/scm` to be in PATH, both of which contain a `git` binary that is the same SCM wrapper. Those will mutually exec each other indefinitely as they fail to detect that they are the same wrapper. Extend the exec-bomb protection to check the paths after all symbolic links have been expanded to prevent this situation. Fixes #43. Fixes Homebrew/homebrew-core#133. Fixed Homebrew/homebrew-core#143. Closes #46. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-07remove legacy Aliases/Formula symlink from LibraryMartin Afanasjew
2016-04-07curl: fall back to /usr/bin/curl when HOMEBREW_CURL doesn't existXu Cheng
This can happen when `HOMEBREW_CURL` is set to brewed curl, but during `brew resinstall curl`, brewed curl's symlink is temporary unlinked. So let's fallback to /usr/bin/curl in this case.
2016-04-07brew.sh: tweak HOMEBREW_PROCESSOR on LinuxMartin Afanasjew
`uname -p` seems to be less useful on Linux (Debian 8 yields `unknown`), thus prefer `uname -m` on those systems to determine the processor type. Closes #35. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-07brew.sh: fix HOMEBREW_OS_VERSION on Linux et al.Martin Afanasjew
On Linux (and other non-OS X platforms), `HOMEBREW_OS_VERSION` was *always* replaced with the product name, leading to less useful user agent. E.g., on a reasonably up-to-date Debian system: Linuxbrew/0.9.9 (Linux; unknown Linuxbrew) With this fix the user agent is instead (first if `lsb_release` is available and outputs something, second otherwise): Linuxbrew/0.9.9 (Linux; unknown Debian GNU/Linux 8.3 (jessie)) Linuxbrew/0.9.9 (Linux; unknown 3.16.0-4-amd64)
2016-04-07brew.sh: avoid unnecessary 'cat'Martin Afanasjew
Bash can read directly from a file in its command substitution.
2016-04-07brew.sh: simplify HOMEBREW_OSX_VERSION_NUMERICMartin Afanasjew
Use `printf -v` and strip out the unnecessary `echo`, thus avoiding two unnecessary command substitutions.
2016-04-07brew.sh: streamline setting HOMEBREW_{OSX,LINUX}Martin Afanasjew
For uses like this one, `case` is much more compact and easier to read.
2016-04-07analytics: avoid unnecessary string interpolationMartin Afanasjew
2016-04-07always prefer HOMEBREW_CURL over plain 'curl'Martin Afanasjew
2016-04-06superenv: comment sources of ignored pathsMisty De Meo
Closes #32. Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-04-06superenv: don't filter out all /opt pathsMisty De Meo
This was intended to filter out MacPorts and X11 paths, but the user may have valid reasons to have other things here that might get linked against.
2016-04-06test-bot: add safety margin to output truncation sizeAndrew Janke
2016-04-06test-bot: stop using --recursive for `brew uses`Dominyk Tiller
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 https://github.com/Homebrew/brew/commit/7b26c585c2a26ec0dad201852ca4934c77fcc493.
2016-04-06tests: update prune --verbose testMartin Afanasjew
Closes #15. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06tests: update linkapps/unlinkapps testsMartin Afanasjew
2016-04-06prune: handle broken app symlinksMartin Afanasjew
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-06unlinkapps: add --dry-run optionMartin Afanasjew
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-06unlinkapps: modernizeMartin Afanasjew
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-06linkapps: modernizeMartin Afanasjew
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-06brew.sh: make analytics 'curl' fully asynchronousMartin Afanasjew
If analytics are enabled and `brew` is used in a command substitution context, e.g. `brew search` for tab completion, the result is that even though the Google Analytics `curl` process runs in the background it still is attached to the captured `stdout`, thus could theoretically contribute to the result of the command substitution and consequently makes the command substitution block on the completion of this process. Redirecting `stdout` (and `stderr` for good measure) to `/dev/null` makes this process truly asynchronous in these contexts. Furthermore, even if the process is in the background, it is still included in the shell's job list and thus shell internals like `wait` (used in `cmd/update.sh`) have to wait on this process, even if they never intended to do so. Removing the analytics process from the job list via `disown` avoids this unintended effect. Fixes #29. Closes #34. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06test-bot: fix access to relocated methodMartin Afanasjew
Fix bug introduced in a2c23dfec569c6e73d90cb20c7d4c26cced258d5. Moving this method apparently made it inaccessible from `Homebrew::Step`.
2016-04-06test-bot: fix undefined method errorMartin Afanasjew
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-05audit: require plist_options when using plistDominyk Tiller
Closes #19. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-04-05test_cmd_audit: add plist testDominyk Tiller
2016-04-05audit: check plist placementDominyk Tiller
2016-04-05Merge pull request #27 from apjanke/test-bot-xml-filterAndrew Janke
test-bot: revise Step output transcoding and XML character filtering
2016-04-05FileUtils::mktemp pass gid to Etc.getgrgid as intilovezfs
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-05Speed up tab completiontim smith
Fixes #20. Closes #23.
2016-04-05tap: support --full even if installedilovezfs
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-05CoreTap#install: fix clone target settingXu Cheng
When invoking `brew tap homebrew/core`, the input options will be like `{ :clone_target => nil }`. This renders `Hash#merge` a dead operation. It doesn't impact Homebrew itself, but could cause problem for downstream projects Linxubrew/Tigerbrew when they adopt core/formula separation.
2016-04-05CONTRIBUTING.md: update urlXu Cheng
2016-04-05Formula#path: update docXu Cheng
Formulae are all in taps now.
2016-04-05Revert "test-bot: revise Step output transcoding and XML character filtering"Dominyk Tiller
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-04test-bot: revise Step output transcoding and XML character filteringAndrew Janke
Closes #24. Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-04Make new keep? superenv logic opt-inMisty De Meo
Closes #50425. Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-04-04superenv: filter -I/-L paths on dependenciesMisty De Meo
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-04utils/analytics: fix usage of undefined variable.Carlos D'Agostino
2016-04-04formula_installer: report install attempts.Mike McQuaid
Closes https://github.com/Homebrew/legacy-homebrew/pull/50462.
2016-04-04brew.rb: report some exceptions.Mike McQuaid
2016-04-04utils: add analytics functions.Mike McQuaid
2016-04-04Add opt-in Google Analytics.Mike McQuaid
Add the first Google Analytics usage to monitor the command names that are run by Homebrew.
2016-04-04Make Homebrew user agent consistent, use a slash.Mike McQuaid
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.