2476 Commits

Author SHA1 Message Date
Mike McQuaid
6654ff6e13
Merge pull request #3996 from GauthamGoli/common-switch
cli_parser: Add :quiet, :verbose, :debug common switches
2018-03-29 08:15:39 +01:00
Mike McQuaid
62e855c863
Merge pull request #3998 from kabel/rubocop-dependency-order-tags
audit: Fix dependency order with multiple tags
2018-03-29 08:15:04 +01:00
Kevin Abel
1b22e16a08
rubocop: Fix audit for dependency order with multiple tags
Dependencies that have multiple tags (`[:build, :test]`) get sorted into
multiple locations resulting in the cop always reporting an offense
regardless of order.
2018-03-28 20:54:39 -05:00
Gautham Goli
8ef1fb30a0 Add :quiet, :verbose, :debug common switches to be specified 2018-03-29 03:20:14 +05:30
commitay
ca881b3d68 cask audit_spec: rspec auto-corrects 2018-03-28 22:06:01 +10:00
Mike McQuaid
0f4e22e28d
Merge pull request #3981 from MikeMcQuaid/rspec-cleanup
test: rubocop-rspec style auto-corrects.
2018-03-28 11:51:44 +01:00
Mike McQuaid
262666c828 cleanup_spec: add nicer prune matcher alias. 2018-03-28 11:20:57 +01:00
Mike McQuaid
d1b83819de
Merge pull request #3979 from MikeMcQuaid/runtime_dependencies_changes
Make runtime dependencies handling more consistent
2018-03-28 09:13:46 +01:00
Mike McQuaid
8975bf0d5b keg: use Formula#runtime_dependencies. 2018-03-27 14:52:48 +01:00
Mike McQuaid
d8bf3f8d60 tab: default runtime_dependencies to nil. 2018-03-27 14:52:47 +01:00
commitay
2373ee6168 cask audit: check for :latest with appcast 2018-03-27 20:56:05 +10:00
Markus Reiter
32d1f6db8b Fix described_class in custom matcher. 2018-03-27 11:05:57 +02:00
commitay
4020f50c14 cask audit: check for appcast if the cask uses github releases 2018-03-27 16:17:37 +10:00
commitay
594ff9283c
Merge pull request #3974 from commitay/cask-audit-pkg
cask audit: check for allow_untrusted within caskroom taps
2018-03-27 16:12:55 +10:00
commitay
43244e7953 cask audit: check allow_untrusted 2018-03-27 08:57:39 +10:00
commitay
f9c557bc1a cask audit: capitalize Cask 2018-03-27 08:52:35 +10:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Mike McQuaid
ee39940196
Merge pull request #3971 from GauthamGoli/irb-args
irb: Use Parser to parse args
2018-03-25 10:01:47 +01:00
Mike McQuaid
46e6b33d1b
Merge pull request #3967 from amancevice/s3-scheme
DownloadStrategyDetector recognizes s3 URL scheme
2018-03-25 10:01:31 +01:00
Gautham Goli
99438e8e44 Parser: Add env named argument for switch to check environment variables 2018-03-25 11:04:18 +05:30
Alexander Mancevice
a096284d03 DownloadStrategyDetector recognizes s3 URL scheme
DownloadStrategyDetector now detects URLs with the s3:// prefix, e.g.:
  s3://my-bucket/path/to/key/tarball.tar.gz
2018-03-24 17:34:51 -04:00
Mike McQuaid
824b814578
Merge pull request #3968 from amancevice/checksum-eq-defense
Defensive check for Checksum == nil
2018-03-24 16:20:29 +00:00
Alexander Mancevice
58dd8f4770 Defensive check for Checksum == nil
Protects against NoMethodError when checking a Checksum instance with a bad 'other'
2018-03-24 09:04:51 -04:00
Ethan Edwards
06f7d7d696 Allow bottles to use any DownloadStrategy 2018-03-24 10:53:49 +00:00
Alexander Mancevice
9b457ec51e Upgraded use of AWS Ruby SDK for S3
When S3DownloadStrategy is detected in DownloadStrategyDetector an attempt
is made to install & require the aws-sdk-s3 gem.

The AWS S3 SDK is used to sign the URL and handed off to curl_download.
2018-03-22 11:22:07 -04:00
Mike McQuaid
799a05c977
Merge pull request #3916 from claui/improve-file-extension-detection
Improve detection of file extensions in CurlDownloadStrategy
2018-03-21 12:37:52 +00:00
Mike McQuaid
8040c82e9e
Merge pull request #3610 from GauthamGoli/arg-parser
cli : Add basic arg parser and use it for parsing `brew audit` args
2018-03-21 08:56:38 +00:00
Mike McQuaid
d2c23bde6d Audit use of :run dependencies.
These are a no-op so let's remove them.
2018-03-19 10:11:08 +00:00
Mike McQuaid
96ff688b9d upgrade: make pinned error have correct exit code.
Also, display before saying "no packages to upgrade".

Fixes #3936.
2018-03-16 20:31:20 +00:00
Mike McQuaid
13bb2be21f
Merge pull request #3914 from MikeMcQuaid/prune-recursive-test
deps: don't display recursive test dependencies.
2018-03-16 14:20:47 +00:00
Mike McQuaid
cb6828dbe6
Merge pull request #3925 from maxim-belkin/git_remote_exists_bool
append ? to git_remote_exists
2018-03-15 08:20:14 +00:00
Maxim Belkin
c99cfd1591
add ? to svn_remote_exist 2018-03-14 16:55:45 -05:00
Maxim Belkin
f984701c29
append ? to git_remote_exist 2018-03-14 16:30:45 -05:00
Mike McQuaid
1dfeff7274 deps: don't display recursive test dependencies.
You only care about the test dependencies for the specific formula you
are testing right now.
2018-03-14 15:41:20 +00:00
Xu Cheng
d3fce64efb
cleanup: fix removing lock files on NFS
If the underneath file system is a Network File System,
`brew cleanup` will fail to remove the lock files with following error
message:

Error: Bad file descriptor @ rb_file_flock - /path/to/the/lock_file

This commit fixes such issue and adds the corresponding test case.
2018-03-14 21:50:53 +08:00
Claudia
ba830df4e6 Add tests for CurlDownloadStrategy#tarball_path
Sometimes, `brew cask fetch`/`install` fails with an error message
similar to this:

```
==> Downloading https://w3g3a5v6.ssl.hwcdn.net/upload2/game/214692/735
Error: Download failed on Cask 'steamed-hams' with message: Operation
not supported @ rb_sysopen -
/Users/claudia/Documents/dev/brew/var/homebrew/locks/steamed-hams--1.0
.com&Expires=1520937180&Signature=CGmDulxL8pmutKTlCleNTUY%2FyO9Xyl5u9y
VZUE0uWrjadjuz67Jp7zx3H7NEOhSyOhu8nzicEHRBjr3uSoOJzwkLC8LBLKnz%2B2X%2B
iq5m6IdwSVFcLp2Q1Hr2kR7ETn3rF1DIq5o0lHCyzMmyNe5giEKJNW8WF0KXriULhzLTWL
SA3ZTLCIofAdRiiGje1kNYY3C0SBqymQB8CG3ONn5kj7CIGbxrDOq5xI2ZSJdIyPysSX7S
LvEDBw2KdR24q9t1wfjS9LUzelf5TWk6ojj8p9%2FHjl%2Fi%2FVCXNN4o1mW%2FMayy2t
TY1qcC%2FTmqI1ulZS8SNuaSgr9Iys9oDF1%2BPK%2B4Sg==&hwexp=1520937440&hwsi
g=55bc66884b925ef22f8673c33bfcc33b.incomplete.lock
```

To reproduce the issue, check out this branch and run the
`cask/download_strategy` test suite:

```
brew tests --only=cask/download_strategy
```

Or take a real-life example, which would be a Cask whose URL has
**1.** no `.` character anywhere in the URL path itself (outside of
the domain name), **and 2.** at least one query parameter with a `.`
character in it; **and 3.** other query parameters following that
with a combined length of more than 255 characters.

This combination may be uncommon but it exists, especially in
[URLs that change on every visit](1002d41242/doc/cask_language_reference/stanzas/url.md (urls-that-change-on-every-visit)),
for example
[`steamed-hams`](9d7df499cd/Casks/steamed-hams.rb)
from my `claui/cask-games` tap:

    $ brew tap claui/cask-games

    $ brew cask fetch steamed-hams

In a nutshell, **URL query strings sometimes look like a very long
file extension to Homebrew,** which it then proceeds to use as a file
name.

In `CurlDownloadStrategy`, Homebrew seems to apply a heuristic to the
cask URL in order to figure out a possibly meaningful file extension.
Sometimes this heuristic produces immensely long file extensions,
especially when there’s a query parameter with a `.` character in it
but not in the URL path itself (outside of the domain name).

Homebrew then believes that everything after the `.` is a file
extension. In one of the later steps, it tries to create a lock file
containing that extension, which fails because HFS+ cannot handle
files whose base file name has more than 255 characters.

One solution would be to improve Homebrew’s extension detector a bit
so that it won’t cross individual URL query param boundaries any
longer. This is done by adding `&` as a stop character:

```
def ext
  Pathname.new(@url).extname[/[^?&]+/]
end
```

This appears to fix the issue for most (if not all) practical
purposes.
2018-03-13 16:58:52 +01:00
Alyssa Ross
6cd195723f
Merge branch 'master' into undeclared_runtime_dependencies 2018-03-12 09:22:39 +00:00
Gautham Goli
5743f22209 cli : Implement Parser and use it for parsing audit command args 2018-03-09 02:44:50 +05:30
Mike McQuaid
83cca40fc9 RuboCop 0.53.0 manual fixes. 2018-03-08 14:10:02 +00:00
Mike McQuaid
e03f07f302 Rubocop 0.53.0 automatic fixes. 2018-03-08 14:10:02 +00:00
Mike McQuaid
b165f5427f RuboCop 0.53.0 2018-03-08 14:10:02 +00:00
Mike McQuaid
36dadbee47 caveats: remove python caveats.
These instructions are currently incorrect and need to be ported to
`python` 3.x and `python@2` formulae. Until then it's better to not have
them than have them be incorrect.

Closes #3890.
2018-03-08 08:34:20 +00:00
Mike McQuaid
067b9c9e88
Merge pull request #3833 from GauthamGoli/depends_on_order_master
rubocop: Add cop to check `depends_on` order and tests
2018-03-06 08:35:10 +00:00
Shaun Jackman
5500c3b25e unzip_dep_if_needed: Needs unzip not zip [Linux] (#632) 2018-03-05 11:51:08 -08:00
Mike McQuaid
1a51d7fb44 migrator: tweak more messaging.
- Make it clearer what the migrator is doing and why
- Recommend an unconditional brew upgrade
2018-03-05 10:14:39 +00:00
Mike McQuaid
bc3389bdae
Merge pull request #3863 from MikeMcQuaid/python3-changes
Adjust docs and more internal code for Python 3.
2018-03-03 18:17:04 +00:00
Mike McQuaid
83fae62b4f Gemfile.lock: update testing gems. 2018-03-03 10:22:37 +00:00
Mike McQuaid
70253f0009 Adjust docs and more internal code for Python 3.
Now we have `python` for Python 3 and `python@2` for Python 2 some more
adjustments need to be made.
2018-03-03 09:42:25 +00:00
Alyssa Ross
84dda31e82
Add tests for ENV#clear_sensitive_environment! 2018-03-01 17:48:08 +00:00
Alyssa Ross
af682d2d63
Merge branch 'master' into undeclared_runtime_dependencies 2018-03-01 17:39:49 +00:00