From ac8c570417891b6fde791f6ffa3d9cd9931a69b2 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 6 Apr 2009 16:29:36 +0200 Subject: add version, use only modules with an author and a valid date --- gen-gdf.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'gen-gdf.pl') diff --git a/gen-gdf.pl b/gen-gdf.pl index d01dd40..e8537af 100755 --- a/gen-gdf.pl +++ b/gen-gdf.pl @@ -12,8 +12,11 @@ use CPAN::mapcpan; my $options = GetOptions( 'out=s' => \my $output_gdf, - 'dbmap=s' => \my $db_map + 'dbmap=s' => \my $db_map, + 'type=s' => \my $type, + 'list=s' => \my $list, ); + print "preparing gexf ... "; my $dbmap = CPAN::cpanmap->connect( "dbi:SQLite:dbname=" . $db_map, "", "" ); @@ -35,7 +38,17 @@ say "done"; print "creating nodes ... "; $struct_graph->{ gexf }->{ graph }->{ nodes } = {}; -my $packages = $dbmap->resultset( 'packages' )->search; + +my $packages; + +$packages = $dbmap->resultset( 'packages' )->search( + { -and => [ + author => { '!=', 'null' }, + released => { '>', '1970-01-01' } + ] + } +); + while ( my $package = $packages->next ) { my ( $year, $month, $day ) @@ -44,6 +57,7 @@ while ( my $package = $packages->next ) { id => $package->id, label => $package->dist, author => $package->author, + version => $package->version, datefrom => join( '/', $year, $month, $day ), }; } -- cgit 1.4.1