Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

vagrant provision keeps reinstalling CPAN packages #8

Open
apennebaker opened this issue Feb 14, 2014 · 7 comments
Open

vagrant provision keeps reinstalling CPAN packages #8

apennebaker opened this issue Feb 14, 2014 · 7 comments

Comments

@apennebaker
Copy link

Perl::Critic installs successfully on a fresh box with vagrant up. Then, every vagrant provision after that installs Perl::Critic again and again.

Source:

https://github.com/mcandre/mcandre-ubuntu

@alvagante
Copy link
Member

The check for the presence of a module is done with perldoc -l :
$cpan_command_check = $ensure ? {
present => "perldoc -l ${name}",
absent => "perldoc -l ${name} || true",
}
so that specic module might not provide proper docs.
If you have better ways to verify if a perl module is installed let me know.

@apennebaker
Copy link
Author

Good point, I'm not sure what to do in that case.

App::Ack mainly installs a binary, ack. But I'm not sure we could generalize this.

@alvagante
Copy link
Member

What can easily be done is to add a parameter to the define that allows customization of the command to use to check for a module existence.
The default can keep on using perldoc, but in edge cases the user may provide a custom command, whatever it might be

@apennebaker
Copy link
Author

Yeah! onlyif => "/usr/bin/test ! -f <file>" works well for Execs. Could Perl modules get this attribute as well?

@andrewblack
Copy link

Ubuntu doesn't (in my experience) install perldoc by default

$ perldoc -l perldoc
You need to install the perl-doc package to use this program.

@alvagante
Copy link
Member

True, the perl class manages its installation (on Ubuntu).
I'm not a perl guru, and this is what I found online as a way to check, more or less reliably, for the precence of a module, if there are better methods please let me know.
In any case it makes sense to add an option to let users specify custom check commands, for cope with edge cases. I can do it when I find time (not likely in the near future), relevant PRs are welcomed.

@apennebaker
Copy link
Author

Should Class['Perl'] require Package['perl-doc'] before attempting to install Perl modules?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants