Commit Graph

1228 Commits

Author SHA1 Message Date
Frederico Benevides a3cbde0bb3 Fixed the cli to include --skip-cask-deps to skip all casks dependencies 2016-06-03 21:09:19 -04:00
Claudia d10d2c8f7e Fix deadlock in `Hbc::SystemCommand` (#21665)
* Write failing tests for issue #18638

* Fix `Hbc::SystemCommand` to avoid deadlocks; ref #18638

The current implementation of `Hbc::SystemCommand` uses the `Open3` library in a way that causes a deadlock in cases where `STDERR` grows beyond a certain size.

This commit fixes the issue by following the practice suggested in the Ruby documentation, i. e. choosing a stream selection method that avoids deadlocks.
2016-06-03 21:01:34 -04:00
Claudia 6efae29a89 Fix `zap` regression introduced in 6500fa1; ref #21583 (#21607)
This PR fixes an issue with 6500fa1, in which the (internal) installer API was refactored in preparation for the big change. That refactoring missed one case, causing `zap` to break; see #21583.

There are **no tests** included with this fix due to pre-existing coverage issues. Test will follow in a separate commit.
2016-06-01 16:27:59 -04:00
Matt Wean 47383169de [WIP] Change artifact behavior to moving instead of symlinking (#13966)
* Change app artifact to move instead of link

First step towards change in installation behavior mentioned in [13201]

* Fix handling of binaries linked from inside of app bundles

Also adds `appdir` method for interpolation in stanzas

* Change appdir to root Applications directory

* Update 2-app tests

* Refactor: add options, ivars to `Installer`, `Download`

In preparation for upcoming changes, this commit cleans up some code. The commit includes:

- In order to reduce unnecessary object passing, make both the `force` and `skip_cask_deps` option into instance variables of the `Installer` class

- Introduce options hashes to initializers of both the `Installer` and `Download` class

- When the `install --force` command enters the fetch phase, make it explicit in the code that fetching is never enforced in that case.

- Update tests

* Force overwrite artifacts on `--force` reinstall

This commit changes the behavior of a `Moved` artifact such that if the target already exists, `brew cask install --force` will remove the existing target before moving the staged artifact.

In that case, the warning message will say *overwriting* instead of *not moving*.

The behavior of plain `brew cask install` remains unchanged; the same goes for the warning message for that case.

* Change remaining artifacts to move instead of symlink

* Update casks to use appdir in binary paths

* Forcibly overwrite artifacts, modifying flags and using `sudo` if needed

- This commit implements [the proposed behavior for `install --force`](https://github.com/caskroom/homebrew-cask/pull/13966#issuecomment-220830387) when a target already exists and has either permission problems or is not owned by the user.

- The changes apply only when the `force` option is given.

- Reused the existing safeguard from the `.pkg` artifact to prevent deleting important directories by bug or mistake

- The two existing blacklists `SYSTEM_DIRS` and `UNDELETABLE_DIRS` have been consolidated into the `Hbc::MacOS` module.

- `UNDELETABLE_DIRS` now also contains all the entries from `SYSTEM_DIRS` which was a to-do anyway.

- The two blacklists are now also frozen for good measure.

- The utility method `permissions_rmtree` was moved to `Hbc::Utils`.

- The `tried_permissions` part in `Utils` now falls back correctly when there are also ownership issues at the same time.

- Introduced a separate `current_user` method for mocking.

- Added an optional feature to `FakeSystemCommand` so it can now act as a proxy to `SystemCommand`.

- Added tests for various `permissions_rmtree` cases.
2016-05-31 15:23:21 -04:00
Josh Hagins 6e24680086 Require target for generic artifact (#21549)
* Require target for generic artifact

* Add audit check for generic artifacts
2016-05-31 07:30:08 -04:00
Josh Hagins 5639d90012 Bump rubocop-cask to 0.6.1 2016-05-26 14:56:17 -04:00
Josh Hagins f4719c1afe Bump rubocop-cask dependency to 0.6.0 (#21225) 2016-05-15 15:34:00 +08:00
mofeing 9d8d16c611
add Support for VST3 plug-ins 2016-05-04 01:46:09 -04:00
ilovezfs 4071bf25e0 Hbc::CLI::Cleanup: needs_init? should return true (#20449)
Closes #18606.
2016-04-10 13:40:01 -04:00
CC-Dog be5535e891 Accept new homebrew_origin in doctor 2016-04-03 23:37:03 -04:00
Kelly McNeilly 6b775346b8 Remove invalid argument separator passed to chmod
Apple chmod stops parsing options after reading '-N' (which removes
ACL) and expects a file name immediately following. The command
'chmod -N -- file' attempts to clear the ACL on the file '--', rather
than 'file'.
2016-03-24 12:46:42 -05:00
Steven Willis eeaac15b5d Fix argument separator passed to chmod
* Place argument separator '--' before all arguments to chmod where it had
   been incorrectly placed after the permissions argument.
 * The separator should be after any options (like '-R' or '-N') but before
   any permissions, even when they look like options, like '-r'.
 * Add '--' to calls to chmod where it was missing for consistency.
2016-03-08 11:53:29 -05:00
Steven Willis 34717c27ff Log exactly the array to be exec'd from system commands
* The debug message had been formatting filenames like "#<Pathname:/opt/...",
   this change will log exactly the array about to be executed
2016-03-08 11:53:29 -05:00
Vítor Galvão 6badc5b8e6 audit.rb: fix OSDN/SourceForge documentation link. 2016-02-20 17:06:59 +00:00
Josh Hagins 0aca2a124d Allow tokens passed to `brew cask style` to end with `.rb`
Fixes #19072
2016-02-20 00:00:04 -05:00
ilovezfs 70b35d7a5e Run Hbc.init only when needed
Creating directories should be deferred until needed.

Override the needs_init? method and return true if a command needs init.

Currently, only `brew cask install` needs init. Other read-write
operations should fail naturally if Hbc.init has never been run.
2016-02-10 07:11:55 -08:00
Josh Hagins 43b16bc0d7 Update rubocop and rubocop-cask dependencies 2016-02-05 22:09:50 -05:00
Josh Hagins 003bbb14ba Intercept --help flag, treat as help cmd 2016-01-17 22:09:49 -05:00
Josh Hagins 7c3c991444 Use pessimistic lower bound for RUBOCOP_CASK_VERSION 2016-01-17 21:46:01 -05:00
Josh Hagins b9b1a7f807 Add `style` subcommand to run RuboCop against args 2016-01-16 18:19:31 -05:00
Josh Hagins f9df5cf7f3 Add install_gem_setup_path! helper from Homebrew 2016-01-16 18:19:31 -05:00
Vítor Galvão 3876fce011 Merge pull request #17023 from caskroom/installer-unpack
installer.rb: clarify "not able to unpack" message
2016-01-15 14:14:35 +00:00
Vítor Galvão 32806fe45b installer.rb: clarify "not able to unpack" message 2016-01-14 12:54:46 +00:00
Vítor Galvão e22490b03e appcast: remove latest_version 2016-01-14 00:13:09 +00:00
Vítor Galvão 700a024c33 appcast.rb: appcast-sha256 to appcast-checkpoint 2016-01-13 19:26:39 +00:00
Vítor Galvão c1ac0e4656 audit: appcast-sha256 to appcast-checkpoint 2016-01-13 19:26:39 +00:00
Vítor Galvão b7e052d637 Merge pull request #16594 from vitorgalvao/java-caveat
Java caveat
2016-01-08 16:42:51 +00:00
Josh Hagins d90248a853 Merge pull request #16593 from jawshooah/quiet-cleanup-when-no-cache
Don't output cleanup size if no files removed
2016-01-08 11:19:02 -05:00
Vítor Galvão 537f378a2b core: more flexibity with depends_on_java 2016-01-08 15:05:47 +00:00
Josh Hagins 846ff35f5d Don't output cleanup size if no files removed 2016-01-08 09:38:02 -05:00
Vítor Galvão 820be31808 Merge pull request #16385 from vitorgalvao/java-caveat
Java caveat
2016-01-08 14:20:33 +00:00
Josh Hagins b390b68a97 Merge pull request #16399 from jawshooah/casks-as-instances
Load casks as instances of Hbc::Cask rather than subclasses
2016-01-08 07:31:39 -05:00
Josh Hagins 20cfa9d8c5 Tell the user how much disk space was freed after cleanup 2016-01-08 03:42:00 -05:00
Josh Hagins 8d9a65b49b It's Ruby, use OOP! 2016-01-08 03:41:54 -05:00
Josh Hagins d7e3e00175 Rename Cleanup#cleanup_outdated to outdated_only 2016-01-08 03:41:54 -05:00
Josh Hagins 2d70f2c784 Memoize casks in Scopes.all for speed 2016-01-07 23:45:40 -05:00
Josh Hagins 8ee120b1e6 Fix explanatory comment in Scopes.all_tokens 2016-01-07 23:45:16 -05:00
Josh Hagins 9f57c7ff9a Use keyword arguments in Hbc::Cask constructor 2016-01-06 10:33:03 -05:00
Josh Hagins ca8b390443 Replace `full_name` with `name`
Casks are no longer classes, so there's no conflict for `name` anymore
2016-01-06 10:33:03 -05:00
Josh Hagins 2edb8af7d4 Minor optimization to speed up recurring calls to Hbc.installed 2016-01-06 10:33:03 -05:00
Josh Hagins 99c96c0fc1 Fix tests broken by changing casks from classes to instances 2016-01-06 10:33:03 -05:00
Josh Hagins c1d5a2264e Load casks as instances of Hbc::Cask rather than subclasses 2016-01-06 10:31:59 -05:00
Vítor Galvão 1f56c6bc4f Merge pull request #16389 from Amorymeltzer/clarify-resources
Attempt clearer language for fetch and resources
2016-01-06 13:26:59 +00:00
Amory Meltzer cc589ca799 Attempt clearer language for fetch and resources 2016-01-05 10:44:53 -08:00
Vítor Galvão 58f74c4b2e core: added depends_on_java caveat 2016-01-05 15:11:56 +00:00
Josh Hagins 07c5266e54 Use all-caps TODO in generated comment for license :unknown 2016-01-05 01:37:51 -05:00
Josh Hagins e42966644c Add `brew untap phinze/cask` to UPDATE_CMD 2016-01-04 23:22:19 -05:00
Josh Hagins a23e270414 Use global var $stderr instead of constant STDERR 2016-01-04 18:15:28 -05:00
Josh Hagins 205ccc3c3a Print error messages to stderr 2016-01-04 18:15:19 -05:00
Josh Hagins 70022ba549 Add 'brew uninstall --force brew-cask' to Hbc::Utils::UPDATE_CMD 2016-01-04 17:40:51 -05:00