Image Ulrich Habel
About me/Impressum

search

Google


Search WWW
Search rhaen daily

archives

feeds

Perl nation banner logo thing
10.01.2009

CPAN::Reporter - cpan smoke testing with distroprefs

Distroprefs are nice to setup up an automatic way to install Perl modules with CPAN.pm. They have been introduced by the CPAN.pm maintainer Andreas Koenig a while ago. I attended a talk by him at one of the last Perl workshops and I thought noone needs such a feature. Being a cpan tester now I understand why there has to be a way to answer questions which a module is asking during installation. Think of it as Expect for Perl module installation. Basically you just want to sort out the modules which are breaking your mass testing either by hangs inside of the code or by asking stupid questions. In order to activate distroprefs for your CPAN.pm module you have to change the prefs_dir value of your CPAN.pm configuration.

rhaen@arkanum $ cpan
CPAN: File::HomeDir loaded ok (v0.80)
[...]
cpan[1]> o conf init prefs_dir
[...]
 
Directory where to store default options/environment/dialogs for
building modules that need some customization? [/home/rhaen/.cpan/prefs] 

cpan[2]> o conf commit
commit: wrote '/home/rhaen/.cpan/CPAN/MyConfig.pm'

cpan[3]> q
Lockfile removed.
rhaen@arkanum $
The configuration of distroprefs follows the YAML format, so make sure to learn some YAML before you start :). Ok, as I said I usually use the distroprefs for disabling modules. I am testing cpan on Win32 Strawberry Perl and NetBSD 5.0_BETA. It makes sense to maintain two seperate YAML files for each of the OS. Whatever the name of the file inside the prefs_dir is, distroprefs will read it and if it's correct YAML format will interpret it. Here is a small section of my current YAML file for NetBSD.
RHAEN@INSIDE SMOKER$ more cpan/prefs/netbsd-disabled.yml                                                                   --- 
comment: |
  Things not to test at all
match:
  distribution: |
    ^(?x:
    .^   # never matches, only purpose is to let things align nicely
    |ILYAZ/modules/Math-Pari-\d         # Ask for fetching stuff
    |BTROTT/Crypt-DH-\d                 # Hangs forever during tests
    |BTROTT/Crypt-OpenPGP-\d            # Asks for Math-Pari
    |TURNSTEP/DBD-Pg-\d                 # Asks for path to pg_config
    |VIPUL/Crypt-Random-\d              # Asks for Math-Pari
    )|
disabled: 1
The modules listed here won't be built, they are disabled. The best way would be to work out all the questions from the modules, I decided to exclude them first and work on the correct distroprefs settings later. However, I want to share my distroprefs with you, maybe the best way to accomplish this is a git repository. Stay tuned.

[/Perl] [link]

powered by NetBSD