Commit graph

124 commits

Author SHA1 Message Date
phinze
02d1543a24 sudo the rmdir on pkg uninstall
fixes an issue we've hit where chmod 777 is insufficient to allow
Pathname#rmdir to work properly.

refs #1374
2013-10-31 19:33:48 -05:00
Tim Buchwaldt
0d12e96d16 Match non-patchlevel releases of Alfred 2013-10-25 20:48:03 +02: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
Fernando Paredes
a16f12d268 Merge pull request #1181 from andizzle/checklink_bugfix
fix a small bug that could stop the check link process.
2013-10-17 07:01:19 -07:00
wenbin1989
89a0bf74b4 use /bin/ln instead of ln, to prevent link error
people who use GNU core utilities's ln doesn't have -h parameter, so ln -hfs will course error.
use /bin/ln instead of ln to prevent this error
2013-10-14 12:44:43 +08:00
Andy Zhang
70ffbc1b08 fix a small bug that could stop the check link process. 2013-10-09 12:23:24 +11: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
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
04c9b19775 whoops; input needs to be enumerable 2013-10-02 09:51:40 -05:00
phinze
bebcb22ab1 somewhere along the way we lost hdiutil accepting dmg agreements
should take care of #1105
also refs #720
2013-10-02 09:38:53 -05:00
phinze
95877c9d20 fix typo in tar container
refs #1083
2013-09-25 14:40:24 -05:00
phinze
def2ec4545 fix download to track with upstream api change 2013-09-24 12:54:32 -05:00
Benjamin Hawkes-Lewis
ec18210887 Remove .DS_Store files when uninstalling packages
.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.
2013-09-23 11:54:49 +01: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
phinze
711e44b405 reverse default for SystemCommand's print option
we were setting it to false basically everywhere and it was getting
a little silly
2013-09-22 13:44:29 -05:00
phinze
49e29bcf61 require tmpdir to fix container error
the tests require tmpdir for themselves, which is why they didn't catch
this. i hate ruby libraries like this...
2013-09-22 13:06:06 -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
billwanjohi
47ed885fc0 require software_spec in download.rb
another lib looking for formula_support
2013-09-14 16:52:39 -05:00
billwanjohi
5d6642ba13 fixes #1015: requires library with checksum method
homebrew did some library reorganization which broke brew-cask
this should fix it
2013-09-14 16:39:04 -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
Shane Delmore
cb3d16ef48 Simplifying uri source validation. 2013-07-27 15:44:03 -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
413aa0a0aa Renaming cask_title to requested_cask for clarity. 2013-07-26 12:00:27 -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
Fernando Paredes
15f4688a4d Add -qq parameter to unzip to eradicate the unzip __MACOSX caution. 2013-07-21 12:34:57 -07:00
Shane Delmore
9405014011 Replacing regexp file test with File.file?. 2013-07-16 21:58:11 -07:00
Shane Delmore
429eb80cbe Adding support for local casks outside of the casks directory 2013-07-16 15:12:16 -07:00
Fernando Paredes
8f029257bf Merge pull request #415 from fanquake/cask-description-typo
Fix typo in Brew Cask description
2013-07-13 11:38:15 -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
Michael Ford
3d1af71731 Fix typo in Brew Cask description 2013-06-01 01:12:31 +08:00
Vítor Galvão
d933cf3b32 Merge pull request #385 from jamesaanderson/cask-template
Update cask template with shortened link syntax
2013-05-30 04:54:30 -07:00
Kristoffer Sachse
ea5149cde9 Fix typo in usage explanation 2013-05-30 09:58:49 +03:00
James Anderson
11a2af136e Update cask template with shortened link syntax 2013-05-29 06:33:05 -07:00
phinze
3522952f22 clarify install sudo message
since we actually will use sudo if we have an installer
2013-05-27 10:35:44 -05: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
92dbff9b5f use absolute path to ln when linking
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
2013-05-14 12:28:50 -05:00
Paul Hinze
a89494860a check for cask before unlinking during uninstall
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.
2013-05-12 19:55:30 -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