100 Commits

Author SHA1 Message Date
Markus Reiter
eccd20e276 Merge Hbc::Container classes into UnpackStrategy. 2018-07-24 16:44:27 +02:00
Markus Reiter
e5e8033145 Add system_command helpers. 2018-07-22 23:24:18 +02:00
Markus Reiter
8278e9e403 Move verbose from #initialize to #extract. 2018-07-22 20:30:28 +02:00
Markus Reiter
bb29150096 Refactor HashValidator. 2018-07-19 16:41:27 +02:00
Markus Reiter
e5865e7e7f Assimilate Containers with UnpackStrategy. 2018-07-16 23:50:45 +02:00
Markus Reiter
c9c5d8e008 Change Container::me? to Container::can_extract?. 2018-07-16 09:16:50 +02:00
Mike McQuaid
459e2bfa48
Merge pull request #4455 from reitermarkus/heredocs
Use more descriptive heredoc names.
2018-07-12 09:30:35 +01:00
Markus Reiter
7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
Markus Reiter
20ec595cb2 Fix Installer not supporting plain executables. 2018-07-11 16:56:37 +02:00
Markus Reiter
44400db00a Don't let install_phase fail. 2018-07-11 16:46:33 +02:00
Markus Reiter
4e49e8de0d Fix SystemCommand :path. 2018-07-11 15:58:38 +02:00
Claudia
3dbb735f3c
Fix PKG installer environment
This commit solves an issue where the environment handed to
`/usr/sbin/installer` is not the same as the environment used by the
graphical PKG installer.

This is evident in some post-install scripts, e. g. the
`component-10.pkg/Scripts/postinstall` script in the `dymo-label`
cask. The code says:

```
USER_ID=`id -u ${USER}`

launchctl bootstrap gui/$USER_ID /Library/LaunchAgents/com.dymo.dls.webservice.plist
```

The graphical installer will export e. g. `USER=alice`, and
everything works as intended.

However, `brew cask install` does not override `sudo`’s default,
which is `USER=ROOT`. This violates the assumptions in the script.

This commit fixes the issue by configuring `sudo` to override the
following environment variables with the proper user name:

- `LOGNAME`
- `USER`
- `USERNAME`
2018-07-06 09:38:00 +02:00
Markus Reiter
e07e036695 Moving and copying must succeed. 2018-06-01 03:31:12 +02:00
commitay
7a0622ea9e Fix zap --force for uninstalled casks 2018-04-29 08:49:02 +10:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
commitay
b864ae7b40 backing up 2018-02-14 07:57:04 +10:00
commitay
e078becf4f cask move_back: copy / delete 2018-02-14 07:39:44 +10:00
Markus Reiter
102a2a491b Add Homebrew’s bin to PATH for Cask installers. 2018-02-13 18:49:01 +01:00
Markus Reiter
b4df024625 Allow passing down configuration into Cask. 2018-01-27 21:47:18 +01:00
Markus Reiter
6760d26319 Create Hbc::Config class. 2018-01-27 21:47:18 +01:00
commitay
8bf9484823 cask moved: check target writable for move_back 2018-01-13 21:31:00 +10:00
Markus Reiter
683bfee8b0 Add missing to_s. 2017-12-06 11:46:30 +01:00
Markus Reiter
3f7e63a24c
Merge pull request #3492 from amyspark/fix-latest-casks
Properly upgrade Casks with version :latest
2017-11-29 15:00:57 +01:00
L. E. Segovia
ab62be5345 Implement @reitermarkus's comments
Leftover && and remove xattr "copy"
2017-11-29 01:02:50 +00:00
Markus Reiter
f355897afa Only show kext caveat on High Sierra or above. 2017-11-28 21:59:20 +01:00
L. E. Segovia
8386b9384c Solve styling and metadata issues 2017-11-28 13:34:50 +00:00
Markus Reiter
1948729ec8 Refactor caveats and add kext caveat. 2017-11-28 00:20:29 +01:00
L. E. Segovia
8ee6ac2613 Implement @reitermarkus's comments
- Split move into a move_back (and clarify when it is used)
- Remove unused flags
- Raise error if installed Caskfile not found
- Error out if an upgrade fails
- Remove some defensive programming checks
2017-11-16 10:40:32 -03:00
L. E. Segovia
72e673afae Fix reinstall/uninstall tests 2017-11-10 11:33:44 -03:00
L. E. Segovia
94d266e2d6 Rework uninstallation step
Now the artifacts get re-staged, and upon an uninstall/finalize_upgrade
they are deleted by purge_versioned_files instead
2017-11-06 21:27:02 -03:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
commitay
4fde8f56ce add pkg / binary comment 2017-10-07 23:10:59 +10:00
commitay
a7cf6c1ff0 Cask AbstractArtifact: fix install order 2017-10-07 22:06:39 +10:00
Markus Reiter
02362259a5 Don’t reorder “basic” artifacts. 2017-10-04 18:47:55 +02:00
Markus Reiter
51a0de6368 Directly save artifacts in DSL. 2017-10-04 18:47:55 +02:00
Markus Reiter
2c7ef064e4 Refactor DSL and Artifacts. 2017-10-04 18:47:55 +02:00
Markus Reiter
7ee86cfe77 Merge pull request #3256 from claui/pkg-unshadow-options
Unshadow `allow_untrusted` option for pkg artifact
2017-10-03 18:25:59 +02:00
Markus Reiter
e322663836 Merge pull request #3255 from reitermarkus/summarize
Add missing `summarize` method.
2017-10-02 14:21:45 +02:00
Claudia
fbd526ffe6 Unshadow allow_untrusted option for pkg artifact
The pkg stanza has an option called `allow_untrusted`, which is
supposed to cause `/usr/sbin/installer` to be called with the
`-allowUntrusted` switch.

PR #3141 seems to have renamed the `pkg_install_opts` field to
`options`. At the same time, it introduces an `options` parameter for
the `run_installer` method, which shadows the `options` getter
method, causing the `allow_untrusted` option to be silently ignored.

The issue affects just the `pkg` stanza because `Hbc::Artifact::Pkg`
is the only artifact class that has an `options` method.

This commit removes the shadowing by renaming the field to
`stanza_options`; in one case, it uses `_options` for a parameter
name (instead of the more canonical `_`) for the sake of clarity.
2017-10-02 13:34:57 +02:00
Markus Reiter
da66e06068 Add missing summarize method. 2017-10-01 23:33:52 +02:00
Markus Reiter
965ca01596 Fix brew tests leaving last file in trash. 2017-10-01 22:19:07 +02:00
Markus Reiter
e336239829 Add missing summarize method. 2017-09-16 03:36:39 +02:00
Markus Reiter
76cb1462d4 Fix uninstall with :signal. 2017-09-12 01:25:14 +02:00
Markus Reiter
b0c98ba631 Fix _stanza. 2017-09-10 23:12:32 +02:00
Markus Reiter
53ecdd843f Treat every Artifact instance as a single artifact. 2017-09-10 23:12:32 +02:00
Josh Soref
ca32ece84e spelling: packages 2017-09-10 16:39:03 +00:00
Markus Reiter
8779784d70 Fix trash script. 2017-07-30 18:44:53 +02:00
Markus Reiter
eb110e94f0 Merge pull request #2772 from reitermarkus/dmg-eula
Fix DMG mounting.
2017-07-02 02:04:07 +02:00
Markus Reiter
fd5e673d2d Merge pull request #2825 from reitermarkus/refactoring
Refactoring using `Forwardable` and `DelegateClass`.
2017-07-01 05:32:19 +02:00
Markus Reiter
3b4ee58c49 Refactor using Forwardable and DelegateClass. 2017-06-28 09:25:31 +02:00