[CDBI] CPAN / 3-digit version / use version situation and workaround

Matt S Trout dbix-class at trout.me.uk
Tue Sep 20 14:28:45 BST 2005


Some of you may already have noticed that CPAN has indexed 3.0.1 as "3.0"
and completely ignored subsequent releases for Class::DBI itself (although
various other modules in the dist are indexed against 3.0.[67]).

I've spoken to Tony about this via e-mail, and the situation is this -

- PAUSE evals your $VERSION in a Safe compartment
- said Safe compartment can't access disk so can't load version.pm
- so it breaks. for the moment.

However, Damian's Perl Best Practices recommends 3-digit versions, so there
are a fair few popping up - hence there's work in progress to frob the
appropriate bits of the PAUSE/CPAN infrastructure and get this sorted.

In the meantime, you're welcome to try the following semi-tested frob to
get the latest CDBI to install via CPAN - first go into your CPAN directory
and munge 02packages.details.txt.gz as the following

zcat 02packages.details.txt.gz | head -9 >02pkg.head
zcat 02packages.details.txt.gz | egrep -v '^$' | egrep -v '^[^ ]+: ' | \
  perl -pe '/\/([^\/]+)\n$/; $_ = "$1: $_";' | sort -r | \
  perl -pe 's/^([^0-9]+-)(v?[^:]+): //; $v = $p{$1} ||= "$1$2";
            s/\/([^\/]+)\n$/\/$v\n/;' | \
  cat 02pkg.head - | gzip - >02pkg.new.txt.gz

Next, fiddle your o conf urllist to contain something invalid (e.g.
http://invalid.local/) and 'reload index' to regenerate METADATA. Then
restore your urllist and issue a 'force install Class::DBI' - CPAN should
install the latest dist.

This should hopefully fix the general case, although it does rely on authors
having reasonably consistent naming conventions; Tony's is sufficiently
consistent that the above works, I can't guarantee it for anything else.

Please consider the code and explanation from "In the meantime" to "anything
else" to be public domain and mess around with it, improve it and re-post
it anywhere it's going to be handy. Just don't expect a warranty :)

-- 
     Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +




More information about the ClassDBI mailing list