When user run `brew cask` it will list all commands out.
There is a blank help command call issues_url which caused by the newly
introduced constant from #2971
- lib/cask/url.rb: initialize(): add new `:data` attribute to hold post parameters
- lib/cask/download.rb: perform(): dispatch to new class based on `:using => :post`
- lib/cask/download_strategy.rb: Cask::CurlPostDownloadStrategy:
extend curl_args with x-www-form-urlencoded data
- doc/CASK_LANGUAGE_REFERENCE.md: HTTP URLs: document new strategy
- test/cask/test_download_strategy.rb: Cask::CurlPostDownloadStrategy: test new strategy
- Remove quotes from `defaults write` args. With quotes the value is
written as a string instead of a dictionary, which breaks the search
scope in alfred.
- Make the default scope consistent with alfred default
Fixes#2997. Interface is optional DSL stanza `container_type`.
This should only be used in rare instances. It is needed for the
case of a naked executable which should not be unpacked.
Appcasts are a standard way for applications to publish
information about available updates via RSS. Sparkle and
other update frameworks are built upon appcasts.
In a quick test, appcasts were found for 188/360 Casks examined.
This PR adds an optional `appcast` stanza, but does not add
`appcast` to any Cask or make use of the info in any way. It is
intentionally left undocumented.
closes#2996. Moves the logic for creating target directores
from init-time in cask.rb to install-time within the artifact
classes. Removes the need for special-case mkpath for each
new artifact type.
fixes#2847. This PR adds OS X-specific extended attributes
(metadata) whenever :target is used on an artifact. The
extended attributes are available for search software such
as Spotlight or Alfred to discover the artifact under the
:target name.
Limitations: Spotlight specifically chooses to ignore this
attribute for App bundles. Alfred will also ignore this
attribute until the upcoming 2.2 release.
Homebrew changed underneath us, requiring 3 arguments to
`ChecksumMismatchError.new`. This is causing total failure
on Travis, and probably a number of issues will be filed
until we merge and cut a bugfix release.
Adobe Air applications take the form of a .air file that the Adobe Air
runtime then installs and creates a .app -- typically in
/Applications. This patch provides a new container for those .air
files which the Adobe Air runtime installs to the Caskroom as well as
tests for Adobe Air app installations.
Presently, if homebrew-cask doesn't detect the Adobe Air runtime, it
will provide an informative error message and instructions to obtain
it via `brew cask install adobe-air`. This is obviously not ideal and
the installation process for the runtime should be automated in the
future.
Following up on #2874, we should no longer need `linked_path`,
but instead simply refer to `target`.
This also fixes a bug in which some links were not removed
during `uninstall`. Example:
binary 'oclint-0.7-x86_64-apple-darwin-10/lib/oclint', :target => '/usr/local/lib/oclint'
Following up on #2719. MD5 checksums are
* nowhere mentioned in our docs
* not used in any existing Cask
* deprecated in Homebrew
Therefore it seems sensible to delete this code.
we had collision issues with homebrew's 'cask' formula (for the emacs
package manager project).
this keeps the in-project and in-formula visibility of the version
number via the old "namespaced global" strategy that keeps a `Cask`
constant out of view of the formula.
Fixes#2817. This is now more consistent with Homebrew's
`list`, though not completely, because Homebrew's `list`
refuses to give any output when there is an invalid Formula
argument. Our `list` stumbles forward instead, giving such
output as is possible based on valid args, but still exiting
with error when invalid args are seen.
Previously, SystemCommand commands and arguments were processed as
strings which caused problems during shell interpretation if the
arguments were not escaped properly. Now all commands are expressed
as arrays and no longer require their arguments to be escaped.
Additionally, stderr and stdout could have been interleaved in the
past and now they are always separated.
For external commands which do not support the doubledash convention
(#2613), wrap file arguments in Pathname.new(file).realpath at the
very last minute. This provides a guarantee against surprises caused
by unusual filenames which might be misinterpreted as flags.
Fixes#2650 (although there is more work to be done). The issue is that
path.readlink.exist? returned false for all relative links, because readlink
reads relative to the current working directory. This caused relative
symlinks such as /usr/bin/tar to be deleted, because package mosh identified
/usr/bin as one of its container directories.
The simplest fix is not to use readlink at all, because path.exist?
will tell us what we want to know, independent of current dir.
- add new file "cask/utils.rb" analogous to "utils.rb" in Homebrew
- define odebug and odumpcask, analogs of ohai and friends, but
which only give output when --debug is in effect
- move the debug setting from an instance variable in Cask::CLI
to a method Cask.debug, defined in "lib/cask/options.rb", which
was added in #2276. (Perhaps options.rb should be merged back
into Cask::CLI).
- sprinkle odebug statements liberally throughout the codebase
- update tests
This safety feature addresses #2650 somewhat indirectly.
A list of system directories is defined. When the uninstall
process encounters a "system directory" it does not touch that
directory at all
- no chmod on that dir
- no search for broken symlinks in that dir
- no cleanup of .DS_Store files in that dir
Explictly listed files from a pkg receipts are not affected by
this change. Individual files will still be removed, even if
those files are in a special "system directory"
Fixes#2601
- do a soft test to see if the service is loaded before attempting remove
- test/unload as both superuser and user as the service can be installed
differently according to the original packags
- add tests for uninstall :launchctl; there were none previously
For safety.
- This is a step toward reworking system_command.rb so that
invocations are done in list form on the back end, avoiding
surprises from quoting and shell metacharacters.
- There is one transitional hack here: the _quote method in
Cask::SystemCommand is modified to avoid double-quoting. The
_quote method itself will go away in a future revision when
only list-forms are used.
- Casks using system are not touched. It seems natural to
address that when creating the DSL for after_install/before_install.
This is the promised followup to #2496
- docs
- test
- bugfix: search string was being tested against fully-qualified
Cask name including Tap, so "brew cask search phinze" would
(confusingly) return all Casks.
Make caveats a first-class member of the Cask DSL. It no longer has to
be specified with "def caveats", but can be given as "caveats do ... end"
as with after_install blocks.
In addition, create a mini-DSL which can be used within caveats blocks,
providing standard messages when manual installers must be used,
reboot-required, etc.
Add alternate form: caveats can also accept a compile-time string for
simple cases.
This is 99% compatible with old Casks, as it still works by defining
a caveats method. However, all Casks containing caveats are cleaned
up and adapted according to the new DSL.
Full docs in CONTRIBUTING.md.
gives project-internal visibility of the version constant for use in
displaying to the user.
the formula now does a targeted require to get the version constant from
the new location.
The difference between specifying caskroom_only and specifying
no install artifact at all is: caskroom_only respects the
uninstall stanza. Obviously this is not the best implementation:
uninstall support should be refactored into the base class.
The indentation in CONTRIBUTING.md implies that :script accepts a hash.
But that is not the case. Instead :script accesses the entire hash defined
by uninstall. Unrelated install keys such as :quit leak through to
@command.run! when attempting to exec :script. Result: contrary to docs,
:script cannot be combined with other uninstall keys.
This PR makes uninstall :script accept a hash. When :args or :input are not
needed, :script can still accept a plain string, so many Casks require no
alteration.
In addition
- adds key :executable, required when using hash argument to :script
- keys to :script are validated and sanitized before being passed to
@command.run!
- adds :quit to with-installable.rb test to protect against regression
on leaky keys
form "<user>/<repo>/<cask>" may be used on cmdline, matching homebrew
- refactor Cask::Source::Tap into Cask::Source::Tapped, removing
code, only handling unqualified cask names here now (ie no slash)
- create Cask::Source::TappedQualified, handling "<user>-<repo>/<cask>"
form as before, and new form "<user>/<repo>/<cask>", for the case that
the relevant tap already exists
- create Cask::Source::UntappedQualified, handling both command-line
forms as above, but implicitly creating adding a new tap if it
does not already exist
- add module Cask::QualifiedCaskName for utility functions on qualified
Cask names
- abstracts out common logic, much code removed
- fixes one bug/inconsistency: some artifacts failed to
"return false" when the target exists in "preflight_checks".
- one trivial functional change: artifact type and quotation marks
added in all user feedback (quotes needed b/c of pathnames
containing spaces)
- move the interface from top-level methods to hash arguments of URL to
keep the cask DSL as skinny as possible
- promote the Cask::Headers object up to a Cask::URL object that
encapsulates all infornation about the URL
- pull all knowledge about curl arguments into the DownloadStrategy,
leaving URL to act as a value object to be queried for details
- test at the DownloadStrategy level; setting up expected curl args
and example casks
This makes uninstall process flag arguments in the same manner
as install. Any argument with a leading dash is assumed to be a
flag, not a Cask. Argument processing still needs work, unknown
flags and spelling errors are silently accepted.
Proposed order - :script, :launchctl, :quit, :kext, :pkgutil, :files. Quit
a process before attempting to unload an assocated kext, unload kext before
attempting to delete the associated file, etc. Arguably :script fits
loically with :files near the end of the list. However, we also have
:after_uninstall which implicitly fires immediately after :files.
Therefore, running :script early provides greater functionality.
This should not be needed for .qlgenerator or .prefPane, because
(like .app) those are always directories/bundles and therefore must
be transported in some type of container.
this allows us to experiment with behavior that we may not want to
promote to an official feature just yet.
i'm thinking about stuff like #544, and other things i can't foresee
we'll have to be careful to not let this get out of hand, but i think
it could be helpful for cask authors to be able to try and problem solve
locally.
- brew cask list now displays casks without backing ruby files
- casks without a source are displayed as "caskname (!)"
- these casks can be uninstalled, with the caveat that it only removes
their files from the caskroom (doesn't run pkg uninstall or anything,
since there's no ruby file to define what to do)
- introduce Cask::Source to encapsulate different types of loading
behind a consistent interface
- mostly this is method-level reorg, kept refactoring of the internals
of these methods to a minimum for this pass
- this is preparatory cleanup for adding the ability to represent a
cask without a backing ruby file
- document sf link policy
- change audit to accept old and new style links
- need to keep old style links for projects where the 'latest' link
does not point to something usable
- link to official policy in audit warning message
refs #1436
hdiutil can output DMG agreement information before the output plist
xml, and our plist parser was choking on that text before the xml
started.
so now we scan to the beginning of an xml document before trying to
parse the xml.
also added much more explicit error handling around the plist parsing,
to hopefully catch related and future plist-related errors.
refs #914
- do not remove *all* symlinks from referenced dirs, only broken ones
- restore dir permission after use so we don't leave behind 777 dirs
- add some better testing around `Cask::Pkg`
- clean up `FakeSystemCommand` interface in tests
refs #1274
- add `run!` method which raises if command does not succeed
- use `run!` when the command we are running must succeed for things to
move forward. this should help produce clearer error messages in
failure scenarios.
- move caveats earlier in the install process so reports can be made
about potential failures
- remove the destination tree on cask install failure, so the cask will
not be considered installed
This cask install the batch version of Prey package, as detailed in:
http://support.preyproject.com/kb/installation/how-to-deploy-prey-in-batch-mode-mac-os
As it requires an API key to be installed, a warning is displayed to the
user with an explanation on how to fix the issue.
Also added -E option to sudo invocation so environment variables can be
passed to the installer.
closes#953
Signed-off-by: phinze <paul.t.hinze@gmail.com>
- this allows us to support casks for things like "dmg in zip" "zip in
tar", etc, etc
- a nested container can be any format that homebrew-cask supports
- the existing container support is now referred to as a Cask's
"primary container"
- use the `nested_container` artifact type to indicate the relative
path to a nested container that you wanted extracted
- multiple layers of nesting should work with multiple nested_container
directives (though this is untested as yet)
- add SpeedDownload as the first cask to use this feature; refs #602
= New Concept: Cask::Artifact
An Artifact is a file in an extacted container for which homebrew-cask
should take some sort of action on install/uninstall.
== Current artifacts:
- App: link/unlink to ~/Applications
- Pkg: install/uninstall (with sudo)
- Prefpane: link/unlink to ~/Library/PreferencePanes
= New Feature: Preference Pane Handling
Specifying `prefpane 'MyApp.prefPane'` in a Cask causes it to be linked
on install to the correct location for it to show up in System
Preferences.
refs #69
= Removed Commands: linkapps/unlinkapps
These were old and mostly unused and don't really make much sense when
linking/unlinking happens automatically in the install process.
= Changed Behavior: stricter relative pathname requirement
With this refactor, we remove the fuzzy searching for a file in an
extracted container when that file was referenced from `link`
or `install`. There may be some casks that need to be updated due to
this change.
.DS_Store files (http://en.wikipedia.org/wiki/.DS_Store) may litter
directories installed with pkgutil preventing them testing as empty and
getting deleted. Delete them along with symlinks.