Commit Graph

108 Commits

Author SHA1 Message Date
Lucas Garron ee30f839d2 QuickLook plugin support. 2013-11-14 20:26:07 -08:00
Shane Watson 0627d3a909 Use exit codes 2013-11-10 13:30:11 -08:00
phinze 1ba71a3554 remove empty app dirs from caskroom on uninstall
previously an install + uninstall would leave around an empty dir with
the app's name. now we clean that up.

refs #1461
2013-11-10 14:48:16 -06:00
Shane Watson 8ab01bc255 Guard against unspecified casks in CLI 2013-11-10 13:44:10 -06:00
Lincoln Lee 22ee53b1d3 Add caveats to info like homebrew 2013-11-09 18:45:50 +08:00
Paul Hinze d929e6a779 Merge pull request #1504 from phinze/1436-latest-sourceforge-links
new preferred sourceforge url style
2013-11-05 20:25:31 -08:00
Paul Hinze dea18ec540 Merge pull request #1501 from phinze/1083-test-tarballs
add test that exercises tar container
2013-11-05 20:09:59 -08:00
phinze 8feec1de14 new preferred sourceforge url style
- 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
2013-11-05 22:09:15 -06:00
phinze 06506c5643 add test that exercises tar container
refs #1083
2013-11-05 21:33:46 -06:00
Paul Hinze abb842bb44 Merge pull request #1499 from phinze/1035-fix-ambiguious-cask-load
use exact matching when loading a cask
2013-11-05 19:22:41 -08:00
phinze 58ac54ed29 use exact matching when loading a cask
fixes issue where casks with names that were a strict prefix of other
casks would always shadow them.

refs #1035
2013-11-05 21:07:52 -06:00
Paul Hinze 8baff93b12 Merge pull request #1462 from phinze/smarter-plist-parser
more robust plist parsing, and better error handling
2013-11-03 12:54:03 -08:00
phinze 27856b09f8 more robust plist parsing, and better error handling
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
2013-11-03 13:07:18 -06:00
phinze a1fa264465 brew cask list, when given args, list installed files
this mimics (and indeed steals code from) homebrew's behavior

refs #1417
2013-11-03 12:23:08 -06:00
phinze 7ae7a18932 fixes to pkg uninstaller to prevent madness
- 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
2013-10-24 14:56:29 -05:00
phinze a9df0c4c45 fix: reinstall attempt nukes existing files
oopsie!
2013-10-23 19:36:06 -05:00
phinze c85ef168fc require most commands to succeed; cleanup on install failure
- 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
2013-10-20 16:52:51 -05:00
Kevin Deldycke cc4e796a74 Add new cask for Prey project.
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>
2013-10-20 13:18:54 -05:00
phinze c03ada18ec support for nested containers
- 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
2013-10-19 16:20:00 -05:00
Adam Stankiewicz 590a7bb572 fix: Allow for underscores in urls
Signed-off-by: phinze <paul.t.hinze@gmail.com>
2013-10-07 20:03:44 -05:00
phinze 18fb8fc028 support custom prefpanedir option 2013-10-07 17:45:58 -05:00
phinze fd3f3e7dde move cli tests to proper dir 2013-10-07 17:43:03 -05:00
phinze c244385eb2 prefpane support; artifact refactor
= 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.
2013-10-07 13:51:42 -05:00
phinze a9cd8e7101 fix a few bugs around recent changes
- 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
2013-09-22 14:44:31 -05:00
Paul Hinze 70ba5c43c0 pkg uninstall: support kernel extension unloading
this should complete support for `wav-tap` and finish out #839
2013-09-22 08:25:16 -05:00
Paul Hinze 357c49162c when uninstalling pkgs; sudo chmod before examining
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`.
2013-09-22 08:20:18 -05:00
Paul Hinze 21f1cc6544 naked pkg - save files with spaces properly 2013-09-22 08:19:34 -05:00
Paul Hinze 3c9423e8c6 naked pkg support + major container refactor
`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
2013-09-21 21:59:07 -05:00
phinze fbc246fa5c fix overzealous cask already created error
this prevented any cask being created via `brew cask create` that was a
suffix substring of an existing cask.

refs #998
2013-09-09 11:16:26 -05:00
Paul Hinze 5d44948737 remove long-dead submodule directory
refs #348
2013-08-06 14:59:02 -07:00
Shane Delmore f5d1ccb76b Fixed uri in test case 2013-07-30 14:07:11 -07:00
Shane Delmore c28a444bc4 Fixing test file url 2013-07-27 15:08:51 -07:00
Shane Delmore 8ccb22749d Merge branch 'master' into cask-strategy
* 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
  ...
2013-07-26 12:15:43 -07:00
Shane Delmore 583559d84e Issue #6. Adding load from url feature. 2013-07-26 11:54:40 -07:00
phinze 171456dc98 support for install/uninstall
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
2013-07-21 22:01:38 -05:00
Michael Ford 6b5c1af440 Correct Adium URL to fix failing unit test 2013-07-21 21:24:27 +08:00
Shane Delmore 489dfa49b2 Adding absolute cask location test 2013-07-17 10:10:03 -07:00
Shane Delmore 429eb80cbe Adding support for local casks outside of the casks directory 2013-07-16 15:12:16 -07:00
Robert Curth ba52f6377e [#583] Auditing of cask download and checksums
closes #688
2013-07-07 09:06:02 -05:00
Keith Smiley 6404f82d09 Verify appdir after reading command line opts
Helps prevent default appdir from being created regardless of whether
the user configured it or not.

Closes #496
2013-06-15 20:13:05 -05:00
James Anderson 11a2af136e Update cask template with shortened link syntax 2013-05-29 06:33:05 -07:00
phinze 71c97bb2e4 support new one-arg link syntax
refs #304

going forward, casks should use

    link 'Foo.app'

rather than

    link :app, 'Foo.app'
2013-05-23 21:03:37 -05:00
Paul Hinze 9835591935 whoops! pass down force argument to installer
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
2013-05-14 18:08:59 -05:00
Paul Hinze 17026b6e93 don't reinstall already installed casks
thanks to @ccutrer for the catch; this implementation is based on his PR

refs #233
2013-05-11 23:32:17 -05:00
Paul Hinze 3991bd6839 a beta pkg installer
- 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
2013-05-11 23:01:59 -05:00
phinze fed2824c7f add bona fide `brew cask create` command
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
2013-05-11 19:24:17 -05:00
pangratz 5b22534368 Update CONTRIBUTING to reflect newer style guides
Specify that the SHA-1 checksum shall be used and that the name of the
linked app must be specified via `link`

closes #293
2013-05-11 18:55:51 -05:00
phinze 43296f201a whoops; missed a spot 2013-05-11 14:21:01 -05:00
phinze a8b343b869 fix github links in `brew cask info`
refs #294
2013-05-11 14:02:53 -05:00
phinze ce94c6de2a update alfred linking to work with Alfred 2.0
i'm not going to worry about backwards compatibility with Alfred 1.X -
forward to the future!

closes #18
2013-05-11 13:53:10 -05:00