Commit graph

136 commits

Author SHA1 Message Date
Sébastien Gross
8ca2b12e92 Add :bsexec option to command.run
* Similar to `:sudo`, gives the ability to run an external command
  within a given context.
* Exposes `:bsexec` in DSL; not yet documented
* Fixes #7132 (mount dmg image fails if user does not have StartupItemContext(8))
2014-12-12 11:38:41 -05:00
Roland Walker
19ee3986c0 Refactor backend classes to match pre/postflight
From legacy forms "after_install", etc.
* abstract out `method_missing_message` to Cask::Utils
* provide `method_missing` coverage in pre/postflight blocks (fixes #7445)
* fix old-style rendering of Cask name as a classname in
  `method_missing` messages
2014-11-26 12:19:17 -05:00
Roland Walker
ccf2f34b6c comment spelling 2014-11-21 09:24:42 -05:00
ndr
a21dbc85aa Merge pull request #7365 from rolandwalker/add_stage_only
DSL: add stanza `stage_only` (new spelling of `caskroom_only`)
2014-11-18 12:27:54 +00:00
Roland Walker
88b2e92015 DSL: add stanza stage_only (new caskroom_only)
`caskroom_only` was never documented.  Its original purpose was
obsoleted in #4865, and its use has been recently been reduced to
two Casks.

This PR
* continues the rationalization of naming by changing `caskroom_only`
  to `stage_only`. "stage" is the verb for "make a copy under the
  caskroom directory"
* documents `stage_only`
* adds tests for `stage_only`
* validates the argument to `stage_only`
* gives sensible output in `brew cask info` for `stage_only` Casks
* enforces that `stage_only` cannot coexist with any activatable
  artifacts

`caskroom_only` is still supported for backward compatibility,
but should be removed before 0.50.0.
2014-11-18 07:13:15 -05:00
Roland Walker
65c81d2752 DSL remove support for uninstall :files 2014-11-15 12:19:55 -05:00
Roland Walker
fbc9e35556 DSL remove support for after_install and friends
in favor of new-style `preflight`/`postflight` forms
2014-11-14 11:06:01 -05:00
Federico Bond
da0412bd71 Remove unsupported -x option in launchctl command 2014-11-12 11:28:45 -05:00
Roland Walker
09ecd1eb79 DSL: remove support install stanza
now replaced by `pkg`
2014-11-11 11:23:51 -05:00
Roland Walker
b837d6c552 remove support for link artifact
* `app`, `suite`, and `artifact no longer implemented as
  synonyms for `link`
* backward-compatible code/comments removed
* creates class `Cask::Artifact::Suite`
* updates `brew cask info` to show specific artifact type
* fixes stray "Generic artifact" messages
2014-10-29 10:53:49 -04:00
Roland Walker
03350791c6 be more explicit about which errors are rescued 2014-10-23 11:57:47 -04:00
Roland Walker
967aa22793 recast method destination_path as staged_path
* part of DSL 1.0 review
* `destination_path` was always a bit vague (it refers to
  Cask-specific, version-specific location under
  `/opt/homebrew-cask/Caskroom`)
* here renamed `staged_path` to match upcoming command verb
  `brew cask stage`
* rename also intended to reduce confusion when we implement
  copying as a configurable alternative to symlinking
* transitional `destination_path` methods to remain while
  Casks are converted (this was documented as a part of the
  DSL, and used by 39 Casks in main repo)
* unrelated variables containing "stage" recast for clarity
2014-10-18 12:23:36 -04:00
Roland Walker
42770516f7 dsl: add installer :manual
a toplevel artifact, intended to replace `manual_installer`,
which is currently implemented within the `caveats` mini-DSL
2014-10-14 11:34:44 -04:00
Roland Walker
68fdb25129 recast install_script to installer :script
* document installer :script.  install_script was never documented
2014-10-14 11:34:32 -04:00
Roland Walker
1a8884753e sanity check against deleting user files
Needed to reduce danger from typos in "zap" stanzas.

As noted in the comments, this is somewhat simplistic, and
should later be merged with similar logic in lib/cask/pkg.rb.
2014-10-11 12:07:31 -04:00
Roland Walker
41cf7d96f0 docs and tests for new form container :nested 2014-10-09 11:34:37 -04:00
Johnathan Conley
203dae5e60 fix params for kextunload 2014-10-01 12:39:38 -05:00
Roland Walker
0e7be245be Return Cask::SystemCommand::Result object
from Cask::SystemCommand.run

* stderr and stdout are now separated, though both are available
* :print_stderr is made the default, closer to previous behavior
* exit status can be read from the result object
* plist parsing is more naturally handled in the result object.
  The :plist argument to the run method was removed.
* whitespace
2014-09-27 08:59:08 -04:00
Roland Walker
100285702b recast :print => true as :print_stdout => true
in Cask::SystemCommand
2014-09-25 09:31:05 -04:00
Roland Walker
49e6e6eb10 refactor :stderr => :silence
replace with :print_stderr => false

The double test on options[:print_stderr] in system_command.rb
is intentional, and temporary.
2014-09-25 09:23:27 -04:00
Roland Walker
568365194d Merge pull request #6227 from rolandwalker/doc_uninstall_delete
doc/tests switchover to `uninstall :delete`
2014-09-18 06:25:59 -04:00
Roland Walker
0b4ad8714b doc/tests switchover to uninstall :delete
from `uninstall :files`
2014-09-17 10:41:10 -04:00
Roland Walker
f7018e0106 DSL: add artifact stanza
Keeping the `link` stanza in the DSL is a mistake: it will be
confusing when combined with the ability to install by copying.

This PR retires `link` completely, and adds a generic artifact
stanza called `artifact`.  (`link` is removed from the docs, but
will still work for compatibility during transition.)

This only affects one current Cask (dwarf-fortress.rb), and that
Cask may be changed to use `suite` in the future.
2014-09-17 09:09:53 -04:00
Roland Walker
1ddec7128d add uninstall :rmdir
per discussion at https://github.com/caskroom/homebrew-cask/pull/6174#discussion-diff-17516171
refs: #6174

This PR is large because of some test-suite refactoring.
2014-09-16 09:48:32 -04:00
Roland Walker
3ea3d0e0e6 protect against inner ".." in uninstall paths 2014-09-15 11:30:41 -04:00
Roland Walker
00921dd513 functionality and docs for zap stanza
* `zap` was previously supported as a noop for forward-compatibility
* Also adds restrictions against relative paths in `uninstall :files`
* Also documents safety conventions for `uninstall :files`
2014-09-13 10:21:17 -04:00
Roland Walker
ab4f52a781 docs and error messages for new DSL stanza pkg
transition from `install` to `pkg`
2014-09-10 10:54:06 -04:00
Roland Walker
31b778f702 Merge pull request #5923 from rolandwalker/internet_plugin_artifact
add support for internet_plugin artifact
2014-08-26 15:36:33 -04:00
Roland Walker
1b05d18a3b add support for internet_plugin artifact
closes #5909
2014-08-26 11:22:25 -04:00
Federico Bond
4724c32955 Reload QuickLook on plugin uninstall 2014-08-25 14:49:25 -03:00
Federico Bond
ff0a5c10e3 Remove Cask::Decorator 2014-08-15 13:00:52 -03:00
Federico Bond
19084bce63 Add uninstall_phase method to CaskroomOnly artifact 2014-08-11 23:07:36 -03:00
Federico Bond
3cb833c89e Add DSL for after_install and similar blocks 2014-08-11 21:41:06 -03:00
Roland Walker
71c57b3569 bug: use install_phase in caskroom_only / qlplugin
Missed in #4865.  install method was renamed.
Bug exercised by Cask amazon_music.rb.
2014-07-30 13:11:57 -04:00
Roland Walker
cc95c18f07 Give users hint that pkg installs work differently
Users should not have to open the Cask file to figure out why one
cask installs differently than another.

Closes #5402.
2014-07-28 22:27:41 -04:00
Roland Walker
ea27fb8fc2 Merge pull request #4928 from rolandwalker/unininstall_trash_delete
DSL: add uninstall `:delete` and `:trash`
2014-07-02 18:31:04 -04:00
Roland Walker
a8eb05867e add install_script artifact
name matches `uninstall :script`

References: #4688
2014-07-02 18:06:24 -04:00
Roland Walker
3807b888f7 read_script_arguments accepts defaults/overrides
as parameters.  Accept overridden keys when submitted by the
caller, but warn that they are ignored.
2014-06-28 15:30:48 -04:00
Roland Walker
bb119655de harmonize error messages 2014-06-28 15:24:55 -04:00
Roland Walker
bfc962595d generalize read_script_arguments
so that it can be called from multiple stanzas
2014-06-28 15:24:55 -04:00
Roland Walker
ba797f043e move read_script_argument to Cask::Artifact::Base 2014-06-28 15:24:55 -04:00
Roland Walker
4c6e5e2b57 DSL add uninstall :delete and :trash
- `:delete` is intended to replace `:files`
- `:trash` is intended to move files to the OS X Trash
- `:trash` is only a stub — currently all three function identically

References: #4688
2014-06-28 14:51:38 -04:00
Roland Walker
64313c7399 add zap stanza to DSL
The zap functionality here is in working form, but there is not a
corresponding `brew cask zap` command verb, which is to be supplied
in a separate PR.

Like other forward-compatible DSL extensions, it is intentionally
undocumented.

References: #4688
2014-06-28 10:16:54 -04:00
Roland Walker
000487ba31 Merge pull request #4866 from rolandwalker/demote_caskroom_only
DSL: remove special properties of `caskroom_only` stanza
2014-06-28 10:11:37 -04:00
Roland Walker
ed5ea5ed4c recast install/uninstall methods: install_phase
and `uninstall_phase`, to improve clarity, now that we have an
independent `uninstall` artifact.
2014-06-18 20:22:24 -04:00
Roland Walker
3bd2e2a3f5 promote :uninstall to an independent artifact
- separated from class `Cask::Artifact::Pkg` (the `:uninstall` DSL key)
- `:uninstall` can now be invoked for all Casks
- `uninstall_test.rb` also had to be separated from `pkg_test.rb`
2014-06-18 20:22:24 -04:00
Roland Walker
077eecb731 recast uninstall_options as directives 2014-06-18 20:03:28 -04:00
Roland Walker
1e8bbd3c74 recast uninstall_set as directives_set 2014-06-18 20:03:28 -04:00
Roland Walker
57957e73d3 change hardcoded "uninstall" in msgs to stanza var 2014-06-18 20:03:27 -04:00
Roland Walker
d534b0ea6f pass stanza by name to dispatch, instead of set
the set contains the uninstall directives from the DSL,
possibly more than one artifact
2014-06-18 20:01:35 -04:00