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

Dependency checks #17

Merged
merged 19 commits into from Mar 23, 2013
Merged

Dependency checks #17

merged 19 commits into from Mar 23, 2013

Conversation

andytinycat
Copy link
Collaborator

This is an initial attempt at installing required package "depends" and "build_depends" with Puppet. Using Puppet's provider to do this means the hard work is done for us by the Puppet folks - no OS/platform detection required, which keeps things nice and simple.
Notes:

  • It can't handle the version comparison forms (<<, >>, <=, >=) because Puppet can't handle them; we skip them and print a warning message.
  • Handling an "or" string (packages separated with a pipe) isn't possible because we can't assume what the user wants, so we skip them and print a warning message.

@bernd
Copy link
Owner

bernd commented Feb 25, 2013

This is nice! I was actually thinking about doing the same some days ago and started playing with puppet. (see https://gist.github.com/bernd/5028220) But your code looks simpler.

I was thinking about a separate command line action to install the dependencies because installing packages needs to be done as root and I usually build with an unprivileged user. fpm-cook can just run puppet if it's running as user root. If it's running as an unprivileged user it could show something like "Please run sudo fpm-cook install-deps to install ..."

What do you think?

@andytinycat
Copy link
Collaborator Author

Yeah, that's a good point. I normally build as root in a Vagrant VM (heresy, I know) so the thought didn't cross my mind.

Should be a trivial change; I'll hack on it tonight and ping you when it's done.

@andytinycat
Copy link
Collaborator Author

Better late than never.

This adds an extra command, "install-deps", that will attempt to install the dependencies with Puppet if run as root; if not, it complains.

In a build, if you're running as root, it'll try to install the dependencies; if not, it'll die and ask you to run install-deps with sudo.

How's this look to you?

@bernd
Copy link
Owner

bernd commented Mar 23, 2013

Great, thank you! 👍

bernd added a commit that referenced this pull request Mar 23, 2013
@bernd bernd merged commit d2c2e31 into bernd:master Mar 23, 2013
@andytinycat andytinycat deleted the dependency-checks branch March 27, 2013 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants