168 Commits

Author SHA1 Message Date
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
L. E. Segovia
a2730c8618 Implement more of @reitermarkus's comments
- Include tests in context
- replace 'route' with 'path'
- more assorted fixes
2017-11-27 01:29:08 +00:00
L. E. Segovia
e0be066f8b Load Casks only once (and fix style issues) 2017-11-24 01:21:30 +00:00
L. E. Segovia
7ee98eb421 Implement more of @reitermarkus's comments
- Simplify outdated Casks checks
- Make use of RSpec's let(:) and .and syntax
2017-11-24 00:48:14 +00:00
L. E. Segovia
7ce4319012 Upgrade an outdated Cask just by name, no need for --greedy 2017-11-22 16:27:13 +00:00
L. E. Segovia
8ee6ac2613 Implement @reitermarkus's comments
- Split move into a move_back (and clarify when it is used)
- Remove unused flags
- Raise error if installed Caskfile not found
- Error out if an upgrade fails
- Remove some defensive programming checks
2017-11-16 10:40:32 -03:00
L. E. Segovia
36fe355159 Add tests for upgrade recovery 2017-11-13 08:46:08 -03:00
Martin Schimandl
fea5350d52 Add line break to string 2017-11-10 20:16:38 +01:00
Martin Schimandl
2b261ad4a7 Refactor code to reduce characters per line 2017-11-10 20:16:38 +01:00
Martin Schimandl
db2c86204b internal_stanza.rb: Remove obsolete code. Improve detection of missing stanzas
internal_stanza_spec.rb: change do ... end blocks to { } blocks
2017-11-10 20:16:38 +01:00
Martin Schimandl
7f70080c94 Add another test to increase coverage. 2017-11-10 20:16:38 +01:00
Martin Schimandl
dfe4e7641a combine errors to a single if-statement. fix spec test 2017-11-10 20:16:38 +01:00
Martin Schimandl
99b7636008 Fix 'brew style' issues 2017-11-10 20:16:38 +01:00
Martin Schimandl
ff2239509d Change behaviour of 'cask _stanza' command. Add tests for 'cask _stanza' command 2017-11-10 20:16:38 +01:00
L. E. Segovia
72e673afae Fix reinstall/uninstall tests 2017-11-10 11:33:44 -03:00
L. E. Segovia
522a229dbb Fix upgrade tests and some upgrade? leftovers 2017-11-08 08:33:33 -03:00