- 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.
- re-added a lost nil guard on `Dmg` containers
- `FakeSystemCommand` was still returning an array of split lines
instead of a string, even though its real counterpart switched to
string when install/uninstall landed
- flushed out an alfred cli bug
- moved plist parsing down to SystemCommand layer
this helps avoid a situation (which happened with `wav-tap`) where the
non-priveleged ruby code gets permision denied errors while examining the
contents of directories using `Pathname`.
`Cask::Installer` was already much too complex, so I took this
opportunity to throw a `Cask::Container` abstraction around the
extraction part of the package install step.
It goes like this: a Cask's URL points to a Container of some sort. The
containers we currently support are: dmg, zip, tar, and (new) naked.
Naked refers to a raw file that just needs to be copied in place. This
currently just means a pkg file, but in the future it may expand.
A Container knows how to do two things: identify a path as being its
type (`Container.me?`) and extracting the contents of its container to
the proper destination for a Cask (`Container#extract`).
The first Cask we have that supports the naked pkg type is
`heroku-toolbelt`. (Thanks to @sheerun for the Cask definition.)
Other miscellania batched in with this refactor:
- switched to an explicit require strategy rather than globbing
- `Cask::Installer` is instantiated now to match its interface with
other similar collaorators
- simplified zip and tar identification to shorter strings rather than
exact matches of full `file -Izb` output
- `Cask::SystemCommand` gets explicit output redirection options
- many rogue backticks replaced to properly use `SystemCommand`
- fixed misnamed test file `link_checker_spec.rb`
- remove some extraneous `after` clauses in tests; leaning more on
`test/support/cleanup.rb` to uninstall for us
- pkg uninstall `:files` gets a `-rf` to support removing dirs
refs #839 and #1043
* master: (75 commits)
Update Shuttle from version 1.1.1 to 1.1.2
no version but latest
OSX port of the awesome gqrx SDR software
SdrDx – OS X and Windows SDR Software
Updates version for LibreOffice to 4.1
Adds cask for Simon.app
DSP Radio - Software Defined Radio for Mac OS X
CuteSdr, the QT based SDR project from RF-Space.
Updated to Zotero 4.0.9
add maratis 3.21
updated xld to 20130720
Rename HexFiend.rb to hexfiend.rb
Add latest Hex Fiend.
Add AeroFS cask
Update link option.
Add cask for MongoHub (https://github.com/fotonauts/MongoHub-Mac)
Add cask for Robomongo (http://robomongo.org)
Add cask for MongoHub (https://github.com/fotonauts/MongoHub-Mac)
Adding 'Google Earth'.
Add link to OpenOffice
...
accepts a single argument, which is a relative path to a pkg
inside the extracted Cask; homebrew-cask will attempt to install this
pkg after the Cask is extracted via `installer`
because of the many different ways uninstallers work, this
has several features:
- `:script`: a script in the Cask which serves as an uninstaller (e.g.
Vagrant, VirtualBox), uses `:args`, and `:input` keys to interact
with said script
- `:pkgutil`: a regexp which captures all package_ids installed by this
cask; homebrew-cask will list all files installed under these ids and
remove them
- `:launchctl`: a list of bundle_ids for services that should be
removed by homebrew-cask
- `:files`: a fallback list of files to manually remove; helps when
uninstallers miss something
refs #661
this was preventing the `brew cask install --force cask` syntax from
working
the test was wrong too - corrected that so now we're covered from future
breakage
refs #329
this is an attempt to avoid GNU `ln`, which is sometimes installed on
macs by users sick of dealing with the subtle differences of BSD tools
from the rest of the known universe.
refs #328
this was exposed in #313 by @vitorgalvao in his attempt to update the
anvil cask; by adding a link to that cask, (which just so happens to be
the cask that we chose for our "already uninstalled message" test).
the fix is simply to move the "already uninstalled" check *before* we
start to unlink.
- the vagrant cask is our guinea pig
- works for me
- only basic testing at the moment
- i wanted to push something to get the gears turning on this
it turns out the concept is pretty simple. specify a list of pkgs to
install; borrow the patterns from linkables for that. then basically
just run "sudo installer"
refs #14
the create command opens up an editor with template to get started
remove --create override flag from `brew cask edit`
hopefully this will be more straightforward for contributors
refs #306
since ln was not using the -h it was following the target symlink
destination and deciding it was a destination directory. madness
ensued.
also test cleanup and more output and change linkables to use sets
this way travis will be able to cover incoming pull requests of new
casks by running the audit on them. cool!
also:
- add checksums to audit
- fix missing checksums
will help with introducing and removing features, since the Cask
definitions move with every `brew update` and track master but the code
to handle them requires an explicit release and a `brew upgrade brew-cask`
relates to #179
introduces the concept of a default_tap which is where we assume cask
paths that do not exist will end up
this is plumbing to support the incoming `cask edit foo --create`
feature
Install casks into HOMEBREW_PREFIX/"Caskroom" instead of the Cellar.
This prevents us from colliding with normal Homebrew Formulae.
NOTE: this will be a breaking change, with the following effects:
- all installed casks will no longer be reported as installed
- orphans all existing casks in the Cellar
- no automated facility for cleanup or migration of existing casks
refs #38, where we can discuss the implications of this before cutting a
new release
Options can be passed on the command-line and/or using
the HOMEBREW_CASK_OPTS environment variable (which has
lowest priority). There is a single --appdir=PATH option
right now, but this commit enables future awesomeness!
Other minor changes:
* `brew cask help` now returns the same thing as `brew cask`
instead of saying there was “no such command as help”.
* The HEREDOC block now uses Homebrew's #undent instead of the
customed-rolled #gsub version. Cleaner and more flexible.
* `Cask.set_appdir` has been renamed to `Cask.appdir=`. This
is more Rubyish, and of little consequence (the only place
it was previously used was in the tests).
`md5`, `sha1`, `sha256` all take a hexdigest string, e.g:
sha1 'f645e9da45a621415a07a7492c45923b1a1fd4d4'
`no_checksum` takes no argument, and indicates there is no checksum
for this cask. This is *not recommended*, and should only be used for
casks that have no versioned downloads.
`brew cask install` will complain if there is no sum provided (unless
`no_checksum` has been invoked), or if the sums do not match. It will
provide the computed checksum so the cask can be easily amended.
Adapted from @passcod's work in 82cc199ae6
should take care of #104
this was a subtle one - after i reorganized the requires, plist/parser
was getting double required, which broke plist parsing and hence dmg
installs
homebrew does internal caching in ARGV that prevents us from doing the
`ARGV.clear; ARGV << 'newarg'` trick twice.
rather than try to further reach in to homebrew's innards, i figure it's
better to just pass multiple arguments down to homebrew code at once,
since it already supports that
refs #47
this delegates to homebrew's uninstall to get its work done. vanilla
`brew uninstall` actually works, but this gives us a more consistent
interface.
as discussed in #47
should address #33
includes cleanup and tests
i'm not crazy about leaning on installing/uninstalling caffeine in the
tests. it makes for some unnecessarily heavy tests and downloads. but
i'd rather get tests in place first then fix the warts.
Jumpcut is a tgz file whose handling isn't currently supported.
This commit adds support for it.
The test for tar.gz and tar.bz are very similar and could probably
be refactored. Leaving that as an exercise for another time.
Should have more use cases before opening that up.
a cheap way to address #17.
i don't really like it, but after a bunch of research and
experimentation to figure out if we can skip `.Trashes` or remove it,
this was the best i could come up with.
I chose Caffeine since it's relatively small to download. Eventually I'd
like to switch this up so we bundle a dmg, zip, etc that the test suite
wires in to verify that we do the Right Thing (tm) with all those file
types. Probably will want to support `file://` URLs in Casks to help us
for that use case.
Just getting started of course, but this piggy backs on Homebrew's
testing strategy to give us a platform for a fully featured test suite.
Neato!
And the tests provide value right away, as I added some better error
handling to `Cask.load`.
Big things ahead. Just you wait.
turns out a symlink of a directory is both a symlink and a directory, so
you have to test for symlink first if you want to catch it.
this should address #36
Some zip files have a different definition, e.g.
Minecraft has:
application/xml; charset=utf-8 compressed-encoding=application/zip;
charset=binary; charset=binary
Most other zips have:
application/x-empty; compressed-encoding=application/zip;
charset=binary; charset=binary
But the result is the same. So now we test only for:
compressed-encoding=application/zip; charset=binary; charset=binary
Most notably, Cask.all returns an array of strings,
not of Cask instances. This makes things easier, as
well as faster, as there's no need to run map(&:to_s)
everywhere anymore.
self.path is a utility method which returns the path
of the cask from its title. There's something subtle
going in there:
- If `cask_title` is fully qualified, e.g.
"phinze-cask/alfred", it's straightforward.
- If `cask_title` is only the name, e.g.
"firefox-aurora", the name is matched from
the full list (self.all) (which isn't sorted)
and the first result is returned.
Hence, self.path with only the name is not precise.
There might be the possibility to apply heuristics
to do a better match (prefer phinze-cask, or maybe
installed casks?) but that's for another issue :-)
self.nice_listing is another utility method used
in `search` and `list`. It returns a list where
unique casks don't have a prefix, and duplicates
do. The prefix is the tap name. The list is then
sorted. For an example or two, look at the first
comment on phinze/#12.
Instead of only listing `Taps/phinze-cask/Casks`, now list
every taps that has a `Casks` directory. Might conflict with
a few commands for the moment, works OK with `brew cask search`.