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
..
2018-07-06 09:38:00 +02:00
2018-06-30 19:40:14 -04:00
2018-06-30 19:40:14 -04:00
2018-06-15 22:40:33 +10:00
2018-03-19 14:35:49 +07:00
2018-06-09 10:13:28 +02:00
2018-06-30 06:03:51 +02:00
2018-01-27 21:47:18 +01:00
2018-06-09 11:18:40 +02:00
2018-06-30 19:40:14 -04:00
2018-04-07 21:39:51 +10:00
2017-10-03 08:29:20 +02:00
2018-05-25 18:20:02 +02:00
2018-06-09 10:13:28 +02:00