183 Commits

Author SHA1 Message Date
Andrew Janke
e0a8a79921 Style fixes for Rubocop 0.57.1 2018-06-30 19:40:14 -04:00
Markus Reiter
a8bfe09c49 Remove tests for brew cask search. 2018-06-18 16:23:35 +02:00
Vítor Galvão
9831e67452
Merge pull request #4346 from commitay/version-minor_patch
cask dsl versions: add minor_patch
2018-06-16 13:18:21 +01:00
commitay
c5bbf28dd6 cask dsl versions: add minor_patch 2018-06-15 22:40:33 +10:00
Markus Reiter
44f56a0773 Refactor join("") to join. 2018-06-15 13:56:08 +02:00
Markus Reiter
502b393d66 Fix tests. 2018-06-14 22:45:20 +02:00
commitay
c3ac638b9f appcast: remove calculate_checkpoint 2018-06-11 13:15:32 +10:00
commitay
c68526ac09 audit: remove appcast checkpoints 2018-06-11 13:14:00 +10:00
Markus Reiter
12ab263784 Remove Hbc.default_tap. 2018-06-09 10:13:28 +02:00
Markus Reiter
fee2b56e14 Rename Cask tap for specs. 2018-06-09 10:03:21 +02:00
Markus Reiter
3d423b0587 Add path method to Caskroom and Cache. 2018-06-09 09:52:48 +02:00
Markus Reiter
458a1e7903 Remove Locations module. 2018-06-09 09:01:09 +02:00
Markus Reiter
cb7f25ceb8 Refactor brew cask search. 2018-06-07 18:42:30 +02:00
Markus Reiter
845cb99e29 Ignore HOMEBREW_NO_GITHUB_API when testing. 2018-06-07 14:02:31 +02:00
Markus Reiter
717032d86d Use Searchable module. 2018-06-07 14:02:31 +02:00
Markus Reiter
14b3b82fca Remove exact match from brew cask search. 2018-06-07 13:48:35 +02:00
commitay
b9b3952494 cask audit: review changes 2018-06-05 19:20:38 +10:00
commitay
c354d76e47 cask audit: various 2018-06-05 19:13:32 +10:00
commitay
f012b5acf8 cask audit: check for sourceforge appcast 2018-06-05 16:42:19 +10:00
Markus Reiter
de246cc528 Update Homebrew-Cask references. 2018-05-25 18:20:02 +02:00
Markus Reiter
c4222141ac Revert "Update Homebrew-Cask references."
This reverts commit 4475651b548afdcf15c4cf7a7cb57baca1885186.
2018-05-25 17:57:32 +02:00
Markus Reiter
4475651b54 Update Homebrew-Cask references. 2018-05-25 17:56:16 +02:00
Mike McQuaid
5c3ec3e7ca
Merge pull request #4174 from reitermarkus/cask-tap-migration
Add compatibility layer for handling Cask Tap migration.
2018-05-21 14:45:14 +01:00
commitay
16fbcd09da
Merge pull request #4188 from commitay/cask-audit-uninstall
cask audit: installer and pkg require uninstall
2018-05-21 10:25:19 +10:00
Markus Reiter
b4de801a01 Support both Homebrew and caskroom for now. 2018-05-21 01:43:49 +02:00
commitay
1ae2cf9709 cask audit: installer and pkg require uninstall 2018-05-19 12:38:52 +10:00
Markus Reiter
a6d9d45ec3 Clean up compat. 2018-05-17 19:13:37 +02:00
Markus Reiter
19317760da Remove Hbc::Scopes. 2018-04-14 11:45:51 +02:00
Markus Reiter
791af7e910 Move invalid Cask fixtures into sub-directories. 2018-04-14 11:44:19 +02:00
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
commitay
2373ee6168 cask audit: check for :latest with appcast 2018-03-27 20:56:05 +10: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
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
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
joshua stein
7388acb86e Tty: if HOMEBREW_NO_COLOR env var is present, disable color
bin/brew will recognize NO_COLOR variable and copy it to
HOMEBREW_NO_COLOR
2018-02-12 14:19:25 -06:00
Markus Reiter
9f4b4a1699
Merge pull request #3740 from reitermarkus/cask-style
Fix `brew cask style` on Travis.
2018-01-28 17:53:49 +01:00
Markus Reiter
884c57f9f4 Fix brew cask style on Travis. 2018-01-28 07:00:20 +01:00
Markus Reiter
6760d26319 Create Hbc::Config class. 2018-01-27 21:47:18 +01:00
Mike McQuaid
1f48e17f1b rubocop: fix brew style warnings. 2018-01-17 10:42:43 +00:00
Alyssa Ross
78fe082a2b
cask: exit successfully when given no arguments
Fixes https://github.com/Homebrew/brew/issues/3601.
2017-12-24 15:06:49 +00:00
Markus Reiter
a02ce4f8e9 Also remove writer method for Hbc.binarydir. 2017-12-03 10:09:09 +01:00
L. E. Segovia
10a0662dc0 Test upgrade for Casks with version :latest 2017-11-28 00:29:45 +00:00
Markus Reiter
f50ae44980
Merge pull request #3396 from amyspark/hacktoberfest-upgrade
Implement `brew cask upgrade`
2017-11-27 23:41:03 +01:00
L. E. Segovia
8abe60d2dc Remove redundant --greedy 2017-11-27 10:15:13 +00:00