47 Commits

Author SHA1 Message Date
Maik Riechert
e113fd70be add HOMEBREW_CURL_RETRIES 2019-05-18 13:23:08 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
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
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
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 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
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
072127197a Check for range support instead of rescuing error. 2018-09-06 16:25:22 +02:00
Markus Reiter
2ca3439ada Fix downloads directory not being created. 2018-09-05 00:38:19 +02:00
Markus Reiter
c98c71ae64 Show stdout for curl commands. 2018-08-01 11:15:42 +02:00
Markus Reiter
8ae284e871 Use SystemCommand for curl. 2018-08-01 01:04:42 +02:00
ilovezfs
cd2b85c40f
Revert "Use SystemCommand for curl." 2018-07-29 21:45:04 -07:00
Markus Reiter
355df64d93 Use SystemCommand for curl. 2018-07-29 01:23:33 +02:00
Mike McQuaid
ae5e904c08 Only read curlrc if HOMEBREW_CURLRC is set.
This reverses the previous, incorrect order.
2018-04-09 15:43:03 -07:00
Mike McQuaid
99b89e4866
Merge pull request #4022 from stefansundin/disable-curlrc
Tell curl to not use .curlrc
2018-04-08 16:37:49 -07:00
Mike McQuaid
0bd5869319 Add/use HOMEBREW_CURLRC variable. 2018-04-08 15:51:58 -07:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Stefan Sundin
0ec47813f1 Prevent .curlrc from being loaded. 2018-04-06 14:13:26 -07:00
Buck Evan
a2646a8694 fix: crash when curl is not installed 2018-03-18 14:09:23 -07:00
Mike McQuaid
924865ec7f curl: handle more non-executable curl edge-cases.
Address some additional issues mentioned in #3624.
2018-01-11 16:33:20 +00:00
Shaun Jackman
a4033c7196 Do not specify absolute paths to utilities
Specifying an absolute path to utilities is no longer needed,
since environment filtering uses a default PATH.
2017-12-12 09:25:16 -08:00
Martin Schimandl
0db069602e Refactor: Move FormulaAudit.check_http_content to utils/curl 2017-12-03 14:02:55 +01:00
Mike McQuaid
fb6cf0c3f8 More environment filtering fixes
- Make `brew pull` pass through Git environment variables
- Whitelist all `TRAVIS_` variables.
2017-11-27 10:48:03 +00:00
Mike McQuaid
5241d07474 environment filtering: pass through TRAVIS vars.
We use these internally so let's map them to `HOMEBREW_` variables.
2017-11-13 10:01:54 +00:00
Mike McQuaid
a7d74e0f53 curl: unset SSL_CERT_FILE. 2017-11-05 14:45:26 +00:00
Markus Reiter
1f66c9c9e0 Let curl_download handle HTTP 416 error. 2017-09-10 07:23:18 +02:00
Markus Reiter
15e572702e Fix pull. 2017-08-21 22:41:13 +02:00
Markus Reiter
d9587a8b5e Don’t pass --fail for curl_output. 2017-08-11 12:28:58 +02:00
Markus Reiter
fd477365b5 curl_download: Retry once on error 33. 2017-08-10 22:51:09 +02:00
Markus Reiter
2cba322200 Allow curl args to be overriden. 2017-08-08 23:06:40 +02:00
Markus Reiter
ae4bafdb36 Simplify CurlDownloadStrategy. 2017-08-08 18:10:13 +02:00
ilovezfs
986887b413 Revert "Refactor SVN and cURL download strategies." 2017-08-07 14:31:56 -07:00
Markus Reiter
dc5a2c1764 Simplify CurlDownloadStrategy. 2017-08-07 21:31:17 +02:00
Mike McQuaid
e7a81caaf4 Allow brew audit to fake a Safari user-agent.
This allows us to detect if homepages such as e.g. `aiccu` which
blocks `curl` are up or not.
2017-01-07 14:03:08 +00:00
Mike McQuaid
e6fb3c3114 curl: make curl_args more configurable.
Allow configuring whether output should be shown or the default the
default user agent is used.
2016-12-29 12:51:12 +00:00
Mike McQuaid
3bf5e779ab utils/curl: fix Rubocop warnings. 2016-09-11 19:13:00 +01:00
Mike McQuaid
ed5e2ea300 utils/curl: assume Ruby 2. 2016-08-17 10:27:45 +01:00
Mike McQuaid
23306ab434 github: produce better curl error messages. (#441)
* global: add RUBY_TWO global variable.

* test-bot: use RUBY_TWO global variable.

* github: produce better curl error messages.

If we don't know why curl has failed then ensure that the error messages
that it produced are included as part of the user output.
2016-07-12 19:46:29 +01:00
Mike McQuaid
8e0e1642ad Use curl for the GitHub API (#295)
* Move GitHub API module to utils/github.rb.

* Move curl method to utils/curl.rb.

* global: use long curl arguments and an array.

This makes the code more self-documenting.

* utils/curl: support reading curl's output.

* utils/github: use curl instead of open-uri.

It has far better proxy support.

* pull: set Homebrew user agent.

* gist-logs: remove trailing whitespace.

* gist-logs: use first instead of [0].

Easier to read.

* gist-logs: use curl-based GitHub.open method.
2016-06-03 13:05:18 +01:00