Skip Menu |

This queue is for tickets about the CPAN-Dependency CPAN distribution.

Report information
The Basics
Id: 15093
Status: resolved
Priority: 0/
Queue: CPAN-Dependency

People
Owner: SAPER [...] cpan.org
Requestors: david [...] landgren.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.08
Fixed in: 0.09



Subject: cpants.db schema has changed
Hi Sébastien, the cpants.db database now uses DBD::SQLite instead of DBD::SQLite2 and the schema has changed slightly. The attached patch corrects the SQL queries used. The documentation refers to both '$cpandeps' and '$cpandep', so when you cut and paste the example code you get an error. Since the module name itself singular, I chose to rename the occurrences of '$cpandeps' to '$cpandep'. Sub::Uplevel (I think) caused the code to crash, which is the reason for the addition of ref($deps) eq 'HASH' conditional guard at line 370, and I added a defined guard at line 380 because sometimes $requires can be undef I forget which module causes this, but the error message will say where. I haven't had time to investigate this further. Also, setting the verbose flag doesn't seem to produce any more, or less, output when it's set or not, at least when using a cpants db.
7c7 < use DBD::SQLite; --- > use DBD::SQLite2; 39,40c39,40 < my $cpandep = CPAN::Dependency->new(process => ALL_CPAN); < $cpandep->run; # this may take some time.. --- > my $cpandeps = CPAN::Dependency->new(process => ALL_CPAN); > $cpandeps->run; # this may take some time.. 177c177 < my $cpandep = new CPAN::Dependency verbose => 1, --- > my $cpandeps = new CPAN::Dependency verbose => 1, 183c183 < my $cpandep = new CPAN::Dependency verbose => 1, process => ALL_CPAN; --- > my $cpandeps = new CPAN::Dependency verbose => 1, process => ALL_CPAN; 370c370 < unless(defined $deps and ref($deps) eq 'HASH' and keys %$deps) { --- > unless(defined $deps and keys %$deps) { 381,386c381 < if( not defined $requires ) { < warn "Don't know how to figure out prereqs from Makefile.PL for $where\n"; < } < else { < eval "{ no strict; \$deps = { $requires \n} }"; < } --- > eval "{ no strict; \$deps = { $requires \n} }"; 591c586 < my $dbh = DBI->connect("dbi:SQLite:dbname=$cpants_db", '', '') --- > my $dbh = DBI->connect("dbi:SQLite2:dbname=$cpants_db", '', '') 595,597c590,592 < SELECT dist.dist, dist.dist_without_version, author.pauseid, author.name < FROM dist, author < WHERE author.pauseid=dist.author --- > SELECT dist.dist, dist.dist_without_version, authors.cpanid, authors.author > FROM dist, authors > WHERE authors.cpanid=dist.author 633d627 < $dists_sth->finish;
Date: Mon, 17 Oct 2005 11:44:40 +0200
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
To: bug-CPAN-Dependency [...] rt.cpan.org
Subject: Re: [cpan #15093] cpants.db schema has changed
RT-Send-Cc:
David Landgren (via RT) wrote: Show quoted text
> Hi Sébastien, > > the cpants.db database now uses DBD::SQLite instead of DBD::SQLite2 and the > schema has changed slightly. The attached patch corrects the SQL queries > used. > > The documentation refers to both '$cpandeps' and '$cpandep', so when you cut > and paste the example code you get an error. Since the module name itself > singular, I chose to rename the occurrences of '$cpandeps' to '$cpandep'.
Indeed. I corrected these inconsistencies in the devel version. Show quoted text
> Sub::Uplevel (I think) caused the code to crash, which is the reason for the > addition of ref($deps) eq 'HASH' conditional guard at line 370,
I remember discussing this bug somewhere, but can't find a ticket for it so it may have been on IRC. Show quoted text
> and I added a > defined guard at line 380 because sometimes $requires can be undef I forget > which module causes this, but the error message will say where. I haven't had > time to investigate this further.
Ok, I understand why I had a hard time reading your patch : it's reversed :) And you should remember that unified diffs are easier both to read and apply when code has changed. But thanks for the patch. Show quoted text
> Also, setting the verbose flag doesn't seem to produce any more, or less, > output when it's set or not, at least when using a cpants db.
Indeed. The verbose flag is currently only used when in processing mode. I can add a few messages for when loading the CPANTS database. Thanks -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Thanks, your patch was applied in 0.09. -- Close the world, txEn eht nepO.