Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "brew cask info" print out sudo requirement #8817

Closed
radeksimko opened this issue Jan 11, 2015 · 5 comments
Closed

Make "brew cask info" print out sudo requirement #8817

radeksimko opened this issue Jan 11, 2015 · 5 comments

Comments

@radeksimko
Copy link
Contributor

There's a bunch of casks that require sudo permission, but installing all casks with sudo is not the best solution, which is why we should IMO start tracking which casks have this requirement and allow users & external tools to use this fact accordingly.

Related: boxen/puppet-brewcask#22 (comment) and #5667

How do we identify these casks?

I think there might be certain installation types which may be automatically considered as problematic (pkg) + there will be some that we'll have to mark explicitely, e.g. *.app which will only work from /Applications/.

In what format should we print this fact?

I'd can imagine that there are 2 use-cases:
a) user form CLI
b) scripts and external tools

which is why I suggest something like this:

$ brew cask info google-chrome
google-chrome: latest
google-chrome
https://www.google.com/chrome/
/opt/homebrew-cask/Caskroom/google-chrome/latest (385 files, 359M)
https://github.com/caskroom/homebrew-cask/blob/master/Casks/google-chrome.rb
==> Installation requires su privilege
yes
==> Contents
  Google Chrome.app (app)
$ brew cask info google-chrome --requires-su
1

The naming would be subject to discussion as su may stand for super user or switch user, so maybe admin privilege as super user might be too long?

@phinze
Copy link
Contributor

phinze commented Jan 11, 2015

👍 I think we'll catch >80% of the cases in question by just doing this for pkg casks (since they always require sudo).

Rather than special casing --requires-su I think might be better to just add --machine-readable output for brew cask info ... looking into this now...

@radeksimko
Copy link
Contributor Author

Rather than special casing --requires-su I think might be better to just add --machine-readable output for brew cask info ... looking into this now...

Good point, I agree.

phinze added a commit that referenced this issue Jan 11, 2015
 - requires_sudo reports whether we can detect that the cask
   install will need sudo privileges
 - the --machine-readable option for `brew cask info` changes the
   output format to JSON, which is more suitable for parsing from
   external tools

I didn't attempt to include artifact details in the JSON output just
yet, since the first goal of this feature is just to tell
puppet-brewcask (in boxen) whether it need sudo for a given Cask.

refs #8817
@salimane
Copy link

salimane commented Mar 1, 2015

👍

@alebcay
Copy link
Member

alebcay commented Mar 8, 2015

The naming would be subject to discussion as su may stand for super user or switch user, so maybe admin privilege as super user might be too long?

The output in brew cask doctor reads:

==> Running As Privileged User:
No

Thus, it may be best to stick with consistent terminology - so perhaps "Installation requires privileged user" or something along those lines.

@vitorgalvao
Copy link
Member

Not problematic enough and not enough interest in implementing this, so closing as part of issues cleanup.

@lock lock bot added the outdated label Jan 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants