Puppet: System Administration Automated

Support

Ticket #718 (new enhancement)

Opened 1 year ago

Last modified 4 months ago

rudimentary CPAN support

Reported by: jblomo Assigned to: community
Priority: normal Milestone: unplanned
Component: package Version: 0.23.0
Severity: normal Keywords: cpan provider packages
Cc: Triage Stage: Accepted
Attached Patches: Insufficient Complexity: Unknown

Description

Attached is the ruby file I wrote for a CPAN provider for puppetd --version 0.20.1 (this is stable version for debian etch). I plan on updating it for 0.23.0-1 next and providing better error handling. It requires an existing /etc/perl/CPAN/Config.pm file, which I've used puppet to install.

Please let me know if there are mistaken assumptions or errors, I am very new to puppet :)

Jim

Attachments

cpan.rb (1.5 kB) - added by jblomo on 07/14/07 00:30:00.
provider-package-cpan.rb
cpan.2.rb (2.1 kB) - added by jblomo on 07/31/07 00:15:00.
cpan-0.23.0.rb

Change History

07/14/07 00:30:00 changed by jblomo

  • attachment cpan.rb added.

provider-package-cpan.rb

07/18/07 18:44:28 changed by luke

  • stage changed from Unreviewed to Needs more info.

It makes sense to leave this patch here, but I can't apply the patch until it's ported to 0.23.0.

07/31/07 00:15:00 changed by jblomo

  • attachment cpan.2.rb added.

cpan-0.23.0.rb

07/31/07 00:16:41 changed by jblomo

I attached the version that is working for version 0.23.0. Thanks for the review.

07/31/07 00:16:57 changed by jblomo

  • version changed from 0.20.1 to 0.23.0.

11/24/07 04:20:06 changed by luke

  • stage changed from Needs more info to Ready for checkin.
  • milestone set to misspiggy.

12/11/07 07:19:54 changed by luke

  • patch changed from Code to Insufficient.
  • stage changed from Ready for checkin to Accepted.
  • milestone changed from misspiggy to unplanned.

I'm sorry, I know this code has been sitting in the repo for months waiting for me to commit, but I have gotten burned recently by accepting code that doesn't look ready, and this doesn't look ready.

For instance, the latest() method returns a hash when the package type expects a single value. And you're right that requiring that specific Config.pm will limit this to only those platforms that looking for Config.pm in that location, which is too limiting, I think.

I'd like to see support for prefetch(), which most of the other package providers now support, and I'm moving toward not accepting patches that don't have associated code. I can never know if I should accept later patches if there aren't tests against which to compare current behaviour.

04/24/08 07:52:57 changed by luke

  • component changed from client to unknown.

04/28/08 16:24:59 changed by jamtur01

  • owner changed from luke to community.
  • component changed from unknown to package.

05/14/08 18:47:31 changed by choffee

The following will give you the location of the Config.pm if it exists.

perl -le 'for (@INC) { $_ .= $ARGV[0]; print if -f }' /CPAN/Config.pm"

So you could check if that returns a valid file. I know no ruby so that is about my limit I am afraid.

05/14/08 18:49:08 changed by choffee

Is the prefetch function just getting the source files? If so then it should be just the same as the install function with a "get" to replace the "install" for the command.

05/14/08 23:34:07 changed by luke

Prefetch would get a list of all currently installed cpan packages, so that if you're managing many cpan packages they don't all need to do their own query.

06/02/08 22:05:24 changed by technician

There isn't a built-in function for CPAN to list the installed modules. The closest thing is 'r' which shows upgrade candidates. http://www.cpan.org/misc/cpan-faq.html#How_installed_modules

06/02/08 22:05:56 changed by technician

  • summary changed from rudementary CPAN support to rudimentary CPAN support.