2459 Commits

Author SHA1 Message Date
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
Alyssa Ross
51b27039be
Revert "Only check undeclared dependencies on macOS"
This reverts commit fa5245f7adf38833b03e92e42aa5217ac5157773.
2018-03-01 17:30:42 +00:00
Alyssa Ross
fa5245f7ad
Only check undeclared dependencies on macOS
We don't currently have a LinkageChecker on Linux, so can't do this.
2018-03-01 17:30:37 +00:00
Gautham Goli
09f343d496 rubocop: Add cop to check depends_on order and tests 2018-03-01 12:32:25 +05:30
Steven Peters
db615a419a dev-cmd/ruby: fix path to dev-cmd/irb and add test 2018-02-28 09:31:29 -08:00
Mike McQuaid
1811c77ec6
Merge pull request #3813 from maxim-belkin/brew-unix-2
bzip2 and zip dependencies_if_needed
2018-02-21 14:31:24 +00:00
Maxim Belkin
c83dd0d04b brew style: replace tabs with spaces 2018-02-21 13:44:51 +00:00
commitay
bab4bb68ee
Merge pull request #3715 from commitay/moved
cask move_back: copy / delete
2018-02-21 07:47:43 +10:00
Maxim Belkin
14d7a7a08c Code refactoring 4.0 2018-02-20 21:33:38 +00:00
Maxim Belkin
c6dac68d8b Code refactoring v3.0 2018-02-19 10:21:01 +00:00
Maxim Belkin
d25fc5ce50 Code refactoring 2018-02-19 09:54:36 +00:00
Maxim Belkin
73a3592981 Renaming linux-specifix file with tests
Files are globbed based on their name. Therefore, we have to rename
them so tests for Linux are not executed on a Mac.
2018-02-19 08:54:30 +00:00
Maxim Belkin
5cfcd2ae9f
Fixing test 2018-02-16 15:04:43 -06:00
Maxim Belkin
a53171d9fe
Adding tests for dependency_collector on Linux 2018-02-16 14:58:07 -06:00
Shaun Jackman
d70d91cf2a test/utils/svn: Requires svn to succeed 2018-02-15 13:50:09 -08:00
commitay
b864ae7b40 backing up 2018-02-14 07:57:04 +10:00
commitay
e078becf4f cask move_back: copy / delete 2018-02-14 07:39:44 +10:00
Mike McQuaid
b609e406bc
Merge pull request #3795 from MikeMcQuaid/rspec-retry
Use rspec-retry in brew tests
2018-02-13 10:04:24 +00:00