Commit graph

1074 commits

Author SHA1 Message Date
Roland Walker
e0dc8b4497 Merge pull request #4970 from rolandwalker/no_backtick_in_error_messages
don't use Markdown-style backtick in error msgs
2014-06-18 16:35:34 -04:00
Roland Walker
5b35f21345 Merge pull request #4969 from rolandwalker/doc_standard_upgrade_command
standardize the recommended upgrade command
2014-06-18 16:34:51 -04:00
Roland Walker
79e17ae450 Merge pull request #4963 from rolandwalker/doctor_brew_cleanup_needed
detect need for "brew cleanup" in doctor
2014-06-18 16:29:02 -04:00
Roland Walker
87b670e5cd switch to diskutil for eject
Mostly to see if this reduces random Travis errors, but also
because `diskutil eject` is a documented interface, and
`hdiutil eject` is not.
2014-06-18 16:04:17 -04:00
Roland Walker
0954ca4c8f don't use Markdown-style backtick in error msgs
Because backtick has a different meaning in the shell, and the user
may copy-and-paste such text.

Some light re-wording included as well, and a reference to "brew cask edit"
changed to "brew cask cat" for simplicity.
2014-06-18 15:16:26 -04:00
Roland Walker
2ffee346df standardize the recommended upgrade command
in both docs and error messages.

Recent bug reports indicate that `cleanup` commands are essential
in some situations.
2014-06-18 15:15:50 -04:00
Roland Walker
b37e34e2c3 detect need for "brew cleanup" in doctor
User will receive a warning if more than one copy of Homebrew-cask
is installed.

References: #4857
2014-06-18 11:31:12 -04:00
Roland Walker
4c8e530570 move utility methods inside module namespace
Cask::Utils
2014-06-18 11:21:18 -04:00
Roland Walker
6fcf62e6aa Merge pull request #4924 from rolandwalker/suggested_stanza_order
suggested (not enforced) order for Cask stanzas
2014-06-17 05:57:29 -04:00
Roland Walker
3cb729095d suggested (not enforced) order for Cask stanzas
References: #4914
2014-06-16 13:32:08 -04:00
Roland Walker
2bfa4e554a add version helper method to caveats mini-DSL
As was already done (for convenience) for `title`.

References: #4921 .
2014-06-16 12:56:31 -04:00
Roland Walker
df3b0566b0 Merge pull request #4900 from rolandwalker/allow_hdiutil_exit_code
permit `hdiutil` to exit with error code
2014-06-16 07:42:00 -04:00
Roland Walker
0b3134bc1c Merge pull request #4890 from rolandwalker/caskerror_exception_status
show process exit status in CaskError exception text
2014-06-14 20:33:28 -04:00
Roland Walker
bca0abb6bc process exit status in CaskError exception text 2014-06-14 20:19:59 -04:00
Roland Walker
30c8412812 permit hdiutil to exit with error code
Mysterious `hdiutil` errors are a longtime problem with the
test suite, and the largest cause of false Travis failure
reports.

What appears to happen is that `hdiutil` returns a valid
plist output, but also exits with an error code.

Recently, user errors have been reported which seem to be
related to the same problem (#4857).

After #4892 and #4887, we have have more assurances that mount errors
will be caught elsewhere, if the XML is incorrect/missing, or if the
mounts are not returned.

So, for this special case, it should be safe to simply
ignore the error code from `hdiutil`.
2014-06-14 20:19:12 -04:00
Roland Walker
4052928deb DSL: allow version :latest (symbol not string)
Forward-compatibility. Intentionally not documented.  When
version is a symbol, it may only be `:latest`.

References: #4688
2014-06-14 20:05:30 -04:00
Roland Walker
d61f165806 fix typo in comments 2014-06-14 20:03:13 -04:00
Roland Walker
630b1e3f89 add more detail to plist parse error messages 2014-06-14 20:03:13 -04:00
Roland Walker
c78c10855c Merge pull request #4887 from rolandwalker/better_dmg_errors
ensure more informative errors from `dmg.rb`
2014-06-14 18:15:46 -04:00
Roland Walker
ecd038ec6f Merge pull request #4888 from rolandwalker/caskerror_exception_format
don't undent CaskError exception text
2014-06-14 18:15:36 -04:00
Roland Walker
94864be826 Merge pull request #4892 from rolandwalker/sanity_check_plist_parsing
defensive driving against errors running `hdiutil`
2014-06-14 18:14:11 -04:00
Roland Walker
9593e614b5 defensive driving against errors running hdiutil
This may not be strictly necessary.  But it should help track
down the `hdiutil` errors, which are persistent, but occasional,
and hard to reproduce. (We pass a flag to `hdiutil` to make
respond in XML.)
2014-06-14 10:55:04 -04:00
Roland Walker
5e5af23815 don't undent CaskError exception text
The content of `output` is probably not indented, and will be
left-truncated if it is multi-line.  This happens often with
Travis `hdiutil` errors
2014-06-14 09:26:24 -04:00
Roland Walker
01000b0bbf Merge pull request #4868 from radeksimko/x11-caveat
Add X11 support to the `caveats` mini-DSL
2014-06-14 09:07:30 -04:00
Roland Walker
b9b41030b7 ensure more informative errors from dmg.rb
The logic for better errors was already there; this just makes
sure that another exceptional case is handled, and falls through
to the existing error-check.

References: #4857
2014-06-14 08:50:02 -04:00
Roland Walker
3f4f6580e0 cut v0.36.2 2014-06-14 08:19:00 -04:00
Radek Simko
2fe0f616d3 X11 added to caveats DSL 2014-06-14 11:28:03 +01:00
Roland Walker
bd474f3302 remove special properties of caskroom_only
HOLD until #4865 is merged.

After #4865, `caskroom_only` can be subclassed from Cask::Artifact::Base
like any other artifact.  It no longer has the special property of
making `uninstall` stanzas work.

This stanza has never been documented.  It is possible that it will
no longer be needed, after #4865 and subsequent cleanup on Casks that
use this form.

References: #4688
2014-06-13 13:26:58 -04:00
Roland Walker
8ab9bae38d WIP forward-compatible DSL synonyms
This makes the following stanzas available in the DSL as
synonyms to existing stanza, with no change to existing
functionality:
- pkg for `install`
- app for `link`
- suite for `link`
- preflight for `before_install`
- postflight for `before_uninstall`
- uninstall_preflight for `before_uninstall`
- uninstall_postflight for `after_uninstall`

References #4688

This works, but is marked WIP because we are not in a hurry,
and because I intend to add tests.
2014-06-12 11:27:42 -04:00
Roland Walker
744ab4aa39 add some detail when rescuing download errors 2014-06-11 16:28:46 -04:00
Roland Walker
4652e8bbcb cut v0.36.1 2014-06-11 12:47:13 -04:00
Roland Walker
b29a77382b Merge pull request #4812 from rolandwalker/fail_on_nonexistent_pkg
Installation should fail if pkg file nonexistent
2014-06-11 06:54:59 -04:00
Roland Walker
a8a3fe733a Merge pull request #4787 from rolandwalker/already_installed_is_not_error
Downgrade Cask install errors to warnings
2014-06-10 18:21:58 -04:00
Roland Walker
caf6c14ff9 Merge pull request #4804 from rolandwalker/uninstall_coerce_ruby_2.0
fix uninstall for ruby 2.0, multiple uninstall stanza, more
2014-06-10 18:21:04 -04:00
Roland Walker
acded0c6ef Installation should fail if pkg file nonexistent 2014-06-10 18:02:03 -04:00
Tony
d273bb3020 Minor formatting tweaks to CLI help output 2014-06-10 12:33:21 -04:00
Roland Walker
65a4cc6f3a allow multiple uninstall stanzas to work
fixes longstanding bug; aligns code with docs
2014-06-10 12:16:49 -04:00
Roland Walker
4f3ecb1cc3 Downgrade Cask install errors to warnings
Including the case where a Cask is already installed.
Always continue installing when multiple Casks are specified,
only raising an exception at the end of the command (if some
portion of the attempted install actions failed).  Never
exit with an error code if "already installed" was the only
problem seen during the run.

Also tweak error messages.

Fixes #1347, #2677, #4785

Required disabling two tests regarding suggestions on Cask
spelling errors.
2014-06-10 12:13:59 -04:00
Roland Walker
9fdae4583a improve :signal debug message 2014-06-10 09:12:00 -04:00
Roland Walker
f534bbd75a uninstall :files in chunks
micro-optimization; minimize shell invocations
2014-06-10 09:11:46 -04:00
Roland Walker
974877ae7a More robust :signal directive in DSL
Coerce more variations into pairs.
2014-06-10 09:08:34 -04:00
Roland Walker
b65cbbf0fd Coerce :files to Array in uninstall
before invoking `each` method.  This is necessitated by Homebrew's
switch to Ruby 2.0.

Also standardize how all `uninstall` directives are coerced to Array,
in a way that is compatible between Ruby 1.8 and 2.0.

Fixes #4784.
2014-06-10 09:06:50 -04:00
Roland Walker
4bf7d5bdc6 cut v0.36.0 2014-06-07 18:02:33 -04:00
Roland Walker
d7dead6705 Merge pull request #4732 from rolandwalker/force_utf8_encoding
force UTF-8 encodings
2014-06-07 17:19:31 -04:00
Roland Walker
4d199ada2d force UTF-8 encodings
Fixes #4677.  This change is necessitated by Homebrew's recent
switch to Ruby 2.x.  These changes may be incomplete and/or
may not work well with Ruby 1.8.  Travis should test Ruby 1.8
compatibility.
2014-06-07 17:04:42 -04:00
Roland Walker
d8ad14aaa5 Merge pull request #4757 from rolandwalker/https_in_create
prompt for HTTPS URLs in `brew cask create`
2014-06-07 15:35:45 -04:00
Roland Walker
154eb2b12f prompt for HTTPS URLs in brew cask create 2014-06-07 14:36:35 -04:00
Fernando Paredes
a4d479c3c4 Add audit for versioned casks with no checksum
* Check if version is not latest and has a sha256 :no_check for checksum
2014-06-06 21:22:19 -07:00
Roland Walker
bd30615a88 collect_concat is not available in Ruby 1.8
`collect` is fine here. References #4719.
plus bugfix: join into a string so that `render_with_none`
knows to substitute "<NONE>"
2014-06-06 21:48:37 -04:00
Roland Walker
8da1d588bb Merge pull request #4733 from rolandwalker/helpdoc_cleanup
remove issues_url and nullcommand from help output
2014-06-06 20:58:07 -04:00