[DBD-SQLite] DBD::SQLite and CPAN

Ash Berlin ash_cpan at firemirror.com
Fri Jun 19 17:45:27 GMT 2009


On 19 Jun 2009, at 18:37, David Dooling wrote:

> I am trying to clean up the prerequisites for a package that requires
> both DBI and DBD::SQLite (UR).  CPAN wants to order the prerequisites
> in alphabetical order, so it tries to install DBD::SQLite first.  It
> comes to this part of the DBD::SQLite Makefile.PL code
>
>  # Because DBI generates a postamble at configure-time, we need
>  # the required version of DBI very early.
>  my $DBI_required = 1.57;
>  eval {
>          require DBI;
>  };
>  if ( $@ or DBI->VERSION < $DBI_required ) {
>          print "DBI 1.57 is required to configure this module,  
> please install it or upgrade your CPAN/CPANPLUS shell\n";
>          exit(0);
>  }
>
> and fails (although the exit status is zero) because an older version
> of DBI is installed.  Even though DBI later appears and as PREREQ_PM
> in the WriteMakefile call, that line never gets executed, the Makefile
> never gets created, and CPAN will go no further with the DBD::SQLite
> install. CPAN does continue to try to install other modules,
> ultimately failing the requested install because DBD::SQLite is
> missing (or too old).
>
> I am not sure what the issue around the DBI postamble is so I am not
> sure how to fix this so DBD::SQLite to play nicely with CPAN.  Any
> ideas/guidance on how to get this to behave as one might expect?

Two possible solutions I can think of:

1) configure_requires. Doesn't help with old clients
2) Use the 'Are we running under a CPAN shell' from the (now improved)  
Module::Install::AutoInstall.

Oh, a bonus 3rd option.

3) Remove the check and delay it to the first test which does BAIL_OUT  
if DBI is too old.

-ash



More information about the DBD-SQLite mailing list