Live data from Hacker News

Osxc – Simple configuration tool for OS X

osxc.github.io

31–40 of 45 posts

Re: Osxc – Simple configuration tool for OS X

#31
post #29

For some reason I'd never seen Homebrew Cask before, which looks very interesting! Does anyone have experiences with Cask to share?

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

Hiya - author here. Thanks for the feedback on this stuff! It's always good to hear where it's best to focus improvements.

I'm going to address a few of your points specifically.

> There are no upgrades, in many cases it doesn't work.

It's true that `brew cask upgrade` is not yet a thing. I would very much like it to be. I've been sort of avoiding work on the feature for fear of messing it up. But that's no reason to not try to make something work! :) Maybe I'll use this as an occasion to start digging in and getting my hands dirty.

> At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well.

If the purpose of the project is not clear, that's definitely a problem. I'm not aware of many (any?) purely non-gui apps making it in to Cask. The `Homebrew/homebrew-binary` tap is the place for those. I'll go review our included Casks to make sure things are clear.

> I think efforts should be put into merging into Homebrew instead of keeping it separate.

I can understand this opinion, but I think we may actually end up going in the other direction. The places we share code with Homebrew have been the biggest problem areas for us. We are already 90% code independent from Homebrew, and I think moving Cask to its own world may benefit both the project and the users. But of course that's a conversation to have with the (amazing!) project team.

Re: Osxc – Simple configuration tool for OS X

#32
post #9

Earlier quoted context omitted.

Homebrew Cask is awesome! A couple of weeks ago I decided to backup my hard drive, reformat it and reinstall OS X Mavericks to get rid of the cruft that seems to have built up in 4 years, updating from every OS since Mac OS X 10.5 Leopard. I made halfhearted attempts to organize my dotfiles and configuration in the past, like the cool kids do on Github. That’s when I learned about Homebrew Cask ( http://caskroom.io )…

I'm hoping someone could answer this for me. How do you trust the applications that `brew cask` installs? What is preventing `brew cask install firefox` from installing something malicious? When I download an application manually, I trust the site I'm on by virtue of being there and being savvy enough to know it's a legitimate site. But when you script it, you lose the ability to gauge see for yourself what you're do…

Hey there! This is a valid concern, but I don't think it's all that different from using Homebrew. The community maintains the cask definitions, and all pull requests are reviewed via the project team. There's a checksum verification feature built in, though we're still figuring out how to reconcile that with un-versioned download URLs [1].

At the end of the day, when you use any package management software, you are implicitly trusting the team that maintains said software. Perhaps it would be better for us to do our best to force users to make that trust more explicit? It's an interesting question - any suggestions you have would be more than welcome - feel free to open an issue to discuss! :)

[1] https://github.com/caskroom/homebrew-cask/issues/1021

Re: Osxc – Simple configuration tool for OS X

#33
post #29

For some reason I'd never seen Homebrew Cask before, which looks very interesting! Does anyone have experiences with Cask to share?

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

Huh… I’ve installed 17 Casks; no apps have complained about being in ~/Applications. In fact, for properly written apps, it should not matter, so there may be something else going on.

I’ve been using ~/Applications forever for beta testing and accessing two different versions of the same app.

Re: Osxc – Simple configuration tool for OS X

#34
post #17

Earlier quoted context omitted.

The main difference between shell scripts and Ansible playbooks is that shell scripts are imperative, while playbooks are declarative and idempotent. A shell script will be something like install this package create this file change this line in a configuration file While a playbook is like make sure this package is installed make sure this file exists make sure this line is like this in this config file What happens…

I can appreciate this explanation, thanks. I will, however, offer that a well-designed shell script should be able to be run many times in a row without causing any problems. The above script is an example of this. If I wanted to change something in my configuration script, that's totally fine! In fact, I do change it all the time. Since all it does is ask you whether you want homebrew to install something, there is…

To do the same thing using pure shell scripting, you have to write a large number of helper functions to avoid boilerplate. Things like asserting — in an idempotent way — the existence of files (with the right content, the right ownership and mode flags, etc.), services, packages and so on.

Tools like Ansible and Puppet already provide that set of functionality. If you write it yourself, you pretty much end up with something like Ansible, except it's specific only to your use case. Better to focus on commonality.

I'm a Puppet guy myself (although I appreciate the simplicity Ansible can bring to the table), and make extensive use not just of the primitives, but of the ability to bundle primitives as reusable modules. For example, rather than explicitly putting files in /etc/logrotate.d, I define a "logrotate class" and do:

    logrotate::rotation {
      postgresql:
        pattern => "/var/log/postgresql/*.log",
        keep_count => 10,
        require => Package['postgresql'];
    }
However, this is not merely a macro that is expanded in-place. Rather, it's an object which can be referenced (for example, I can have something else which requires that the object Logrotate::Rotation[postgresql] runs first) as well as "inventoried" (I can ask the system about all the log rotations that have been declared, and use that to drive a UI, for example).

The expressiveness and flexibility of tools like Ansible (which must have something similar) and Puppet is best seen in a multi-node server environment, however.

Re: Osxc – Simple configuration tool for OS X

#35
One blind spot that all of these OS X configuration tools appear to have is the App Store. Not through any fault of their own I suspect... more that Apple hasn't opened the App Store app to being scriptable. But a command-line way of installing/reinstalling/updating App Store apps would be great.

Re: Osxc – Simple configuration tool for OS X

#36
post #29

For some reason I'd never seen Homebrew Cask before, which looks very interesting! Does anyone have experiences with Cask to share?

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

You can override the application directory for Cask:

    export HOMEBREW_CASK_OPTS="--appdir=/Applications"

Re: Osxc – Simple configuration tool for OS X

#37
post #31
post #29

Earlier quoted context omitted.

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

Hiya - author here. Thanks for the feedback on this stuff! It's always good to hear where it's best to focus improvements. I'm going to address a few of your points specifically. > There are no upgrades, in many cases it doesn't work. It's true that `brew cask upgrade` is not yet a thing. I would very much like it to be. I've been sort of avoiding work on the feature for fear of messing it up. But that's no reason to…

Is there anything Homebrew can do differently to make things easier for your project?

Re: Osxc – Simple configuration tool for OS X

#38
post #29

Earlier quoted context omitted.

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

You can override the application directory for Cask: export HOMEBREW_CASK_OPTS="--appdir=/Applications"

I know about this, but I would want only the problematic apps to auto select /Application - some work fine in ~/Applications, i.e. the Cask formula can override the appdir default value.

Re: Osxc – Simple configuration tool for OS X

#40
post #29

Earlier quoted context omitted.

Cask could be awesome, but it's not at this stage. There are no upgrades, in many cases it doesn't work. Most apps complain that they are not in /Applications, but are in ~/Applications instead and so on. At the end of the day, it duplicates some of the Homebrew functionality - some non-GUI packages are getting into Cask, because possibly Homebrew doesn't want them - it's a bit confusing as well. I think efforts shou…

Huh… I’ve installed 17 Casks; no apps have complained about being in ~/Applications. In fact, for properly written apps, it should not matter, so there may be something else going on. I’ve been using ~/Applications forever for beta testing and accessing two different versions of the same app.

That's true. I hope more apps improve as well as OS X itself. The issue with ~/Application seems to be OS X-related as reported by HyperSwitch (http://bahoom.com/hyperswitch/), which cannot run in background without being under /Applications.
Post reply on HN