Created
October 24, 2013 23:55
-
-
Save reneeb/7147200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::File; | |
use IO::Dir; | |
my $base_dir = '/root/.cpanm/work/'; | |
my $dh = IO::Dir->new( $base_dir ); | |
while ( my $dir = $dh->read ) { | |
next unless $dir =~ m{\A\d+\.\d+\z}; | |
my $build = IO::File->new( $base_dir . $dir . '/build.log', 'r' ); | |
my $count = qx{ls $base_dir$dir | wc -l}; | |
chomp $count; | |
my $dists = int ( ($count - 1) / 2 ); | |
while ( my $line = <$build> ) { | |
my ($perl) = $line =~ m{on perl (\d+\.\d+)}; | |
if ( $perl ) { | |
print "$perl -> $dists ($count)\n"; | |
last; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment