Commit Graph
312 Commits
Author SHA1 Message Date
Danny Weinberg 6db1b0abd8 Handle regex not finding anything 2019-02-03 10:52:09 -08:00
Danny Weinberg b0124c4fb0 Cask handle already downloaded file
The current logic for curl_download tries to restart any existing
partial download, but this fails for some servers when the file is
already fully downloaded, returning a status code 416. This updates the
function to check for the file being already downloaded and if so bails
early.

The following command used to fail when run more than once but now works
as expected:
```
brew cask info https://raw.githubusercontent.com/homebrew/homebrew-cask/master/Casks/docker.rb
```
2019-02-01 14:57:50 -08:00
Claudia c2bbd9df7e Remove unneeded curl_openssl_or_deps invocation
This fixes a regression introduced in #5626 [1], which removed `curl_openssl_or_deps` and left a single call in the code.

[1]: https://github.com/Homebrew/brew/pull/5626
2019-01-28 08:10:37 +01:00
Mike McQuaid 8bfde013f6 utils: fix SVN remote test on Mojave.
For some reason Mojave needs the SSL args always set otherwise this
will always fail waiting for interactivity.

Also, while debugging this I noticed that `utils.rb` had a failure
expecting an integer so fix that too.
2019-01-22 14:20:24 +00:00
Mike McQuaid 234e4aec96 Improve use of default_prefix? in tests. 2019-01-21 14:33:56 +00:00
Mike McQuaid 699d543ecd Use Homebrew.default_prefix? in more places. 2019-01-21 12:37:42 +00:00
Mike McQuaid ec5ce4b180 utils/github: display max 20 closed PRs.
Closes #5553.
2019-01-19 17:17:21 +00:00
Mike McQuaid 61fa59e95b Remove Travis CI specific code
We’re no longer using this for our CI so this is no longer necessary.

Also, migrate `brew tap-new` to use Azure pipelines.
2018-12-30 21:13:24 +00:00
Sam Hathaway 6e603c2859 Use GET rather than HEAD when checking for range support in curl_download.
* Some HTTP servers apparently support ranges but don't support HEAD.
   * This is a more realistic check anyway since the actual download request
     will use GET (not HEAD).
   * This fixes Homebrew/brew#5420.
2018-12-21 15:11:26 -05:00
L. E. Segovia 3b79b4d079 More styling fixes 2018-11-24 11:21:52 +00:00
L. E. Segovia 6ac568230c Fix styling issues 2018-11-24 01:46:55 +00:00
L. E. Segovia 5a2743b50d Merge branch 'master' into gitjiro-improved 2018-11-24 01:01:40 +00:00
Mike McQuaid 737b84b54b brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaidandGitHub b167a88e4d Merge pull request #5090 from JBallin/gist-token-error
Clarify how to set HOMEBREW_GITHUB_API_TOKEN
2018-10-21 15:41:34 +01:00
EricFromCanada 20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Mike McQuaid 056dd588b2 utils/github: add ValidationFailedError.
These have specific errors returned so would be more useful to output.
2018-10-15 12:03:16 -07:00
JBallin 2bf0db40b3 Normalize formatting of gist-logs errors 2018-10-14 20:40:24 -07:00
JBallin 2a1b936f76 Clarify HOMEBREW_GITHUB_API_TOKEN in gist-logs err 2018-10-14 20:40:24 -07:00
Mike McQuaid c2d23838d0 analytics: fix display of build error options.
Currently these are all like `wget #<Options:0x0000000101171658>`.
2018-10-13 15:09:03 -07:00
Alyssa Ross 864475e14f bump-formula-pr: use GitHub error message info
This saves an API call, and is more accurate, because the repo API
doesn't actually say whether forking is enabled, but this error message
does.

To do this, the original GitHub error message had to be accessible on
the GitHub exceptions.
2018-10-11 16:39:29 +01:00
L. E. Segovia 094cab89fe Cask: remove curl calls, use them with --download 2018-10-10 21:36:06 +00:00
L. E. Segovia 4fe0a63482 Cask: address HTTPS->HTTP redirections 2018-10-10 21:36:06 +00:00
Mike McQuaidandGitHub c6acab66fe Merge pull request #5030 from MikeMcQuaid/style-shellcheck
style: check Bash style with shellcheck
2018-10-08 14:25:28 +01:00
Markus Reiter 5dd571adeb Replace #chuzzle with ActiveSupport’s #presence. 2018-10-07 23:10:56 +02:00
Markus Reiter 16618d0fc7 Use ActiveSupport’s #pluralize and #to_sentence. 2018-10-07 23:10:56 +02:00
Markus Reiter c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Mike McQuaid 4feb851279 Fix brew style shellcheck warnings. 2018-10-07 22:08:59 +01:00
Gautham Goli c7bf79407a Better man page formatting 2018-10-03 19:20:26 +05:30
Markus Reiter 2308f0c571 Skip quitting applications when not logged into GUI. 2018-10-02 16:27:45 +02:00
Mike McQuaid a11fe57cd2 cache_store: handle corrupt DBM database.
When the DBM database cannot be read by the current version of Ruby's
DBM library (due to corruption or another incompatibility) it segfaults
or freezes which takes down the entire Homebrew Ruby process.

This isn't desirable so instead perform a shell out with the Homebrew
Ruby to see if it can read the DBM database before we try to use the
information. If this hangs or crashes: silently delete the database and
recreate it.
2018-09-20 10:57:27 +01:00
Mike McQuaidandGitHub b614cad3b5 Merge pull request #4938 from MikeMcQuaid/travis-cleanup
Cleanup Travis and CI configuration.
2018-09-19 15:36:21 +01:00
Mike McQuaid 59c858a8e8 Cleanup Travis and CI configuration.
Use the environment variables set by `brew test-bot`. Eventually we'll
disable Travis CI running CodeCov so move `TRAVIS` references to
`HOMEBREW_TRAVIS_CI` so it doesn't need whitelisted.

Also, fix `azure-pipelines.yml` so it's testing the correct version of
Homebrew/brew (the one checked out in the `pwd`).
2018-09-19 15:01:33 +01:00
William WoodruffandGitHub 2246780f0b Merge pull request #4853 from woodruffw/error-pipe-check-closed
utils/fork: Check if error pipe is closed
2018-09-19 10:00:01 -04:00
William Woodruff 649a630826 utils/fork: Check if error pipe is closed
Document special interrupt case.
2018-09-18 22:21:12 -04:00
Shaun Jackman 6bd0379449 Utils::Analytics.custom_prefix_label: Fix typo
Change generic-prefix to custom-prefix.
2018-09-18 09:49:19 -07:00
Mike McQuaidandGitHub 4d1de3334c Merge pull request #4912 from MikeMcQuaid/activesupport-hash-deep-merge
Use ActiveSupport Hash#deep_merge
2018-09-18 09:19:24 +01:00
Mike McQuaid 0c6331878f Use ActiveSupport Hash#deep_merge
And delete our own implementation.
2018-09-17 14:53:01 +01:00
Markus Reiter e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Chongyu Zhu 93cac4ccee utils/analytics: make curl respect HOMEBREW_CURLRC 2018-09-14 18:50:03 +08:00
Shaun Jackman f6093961ef Add Homebrew::DEFAULT_PREFIX for Linux
The default prefix is /usr/local on macOS
and /home/linuxbrew/.linuxbrew on Linux.
2018-09-11 09:57:08 -07:00
Markus Reiter 072127197a Check for range support instead of rescuing error. 2018-09-06 16:25:22 +02:00
William WoodruffandGitHub eacdca872e Merge pull request #4819 from woodruffw/error-pipe
utils: Use JSON to marshal child errors
2018-09-04 21:02:29 -04:00
Markus Reiter 2ca3439ada Fix downloads directory not being created. 2018-09-05 00:38:19 +02:00
William Woodruff 367629d289 utils: Use JSON to marshal child errors
Replaces our serialization of child process
errors via Marshal with JSON, preventing
unintentional or malicious code execution outside
of the build sandbox.

Additionally, adds tests for the new behavior.
2018-09-04 11:03:32 -04:00
Mike McQuaidandGitHub 088730c6f1 Revert "Use JSON to marshal errors from children" 2018-09-04 08:37:08 +01:00
William Woodruff 86b9647450 utils: Use JSON to marshal child errors
Replaces our serialization of child process
errors via Marshal with JSON, preventing
unintentional or malicious code execution outside
of the build sandbox.

Additionally, adds tests for the new behavior.
2018-09-03 18:42:59 -04:00
Mike McQuaid 80d75bc0d8 Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Mike McQuaidandGitHub 0dc2c72693 Merge pull request #4795 from MikeMcQuaid/tests-leaks-prompt
tests: handle file leaks and SVN test prompt.
2018-09-02 18:31:44 +01:00
Mike McQuaid bcb1ec5499 Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Mike McQuaid ec9e45a8f0 tests: handle file leaks and SVN test prompt.
- Ignore files that are generated by `brew tests`
- Make the SVN tests work without prompting for GitHub's SSL certificate
2018-09-02 13:43:58 +01:00