new perls v5.39.10
[andk-cpan-tools.git] / bin / build_dir_history.pl
blobd50eb1933070345f728b5e2b52967e499a73ff84
1 =pod
3 Script to give an overview about the contents of the build_dir/
5 Status: highly experimental, not intended to be ever brought into production
7 Todo: select data, filter on data
9 =cut
11 use strict;
12 use warnings;
14 use lib "lib";
15 use CPAN 1.8861;
16 use File::Basename;
18 CPAN::HandleConfig->load();
19 my $bd = $CPAN::Config->{build_dir};
20 opendir my $dh, $bd or die "Could not opendir $bd\: $!";
21 my @history;
22 for my $dirent (readdir $dh) {
23 next unless $dirent =~ /\.yml$/;
24 my $yaml = CPAN->_yaml_loadfile("$bd/$dirent")->[0]; # XXX note: uses internal function
25 my(undef, undef, $author) = split m|/|, $yaml->{distribution}{ID};
26 push @history, [$yaml->{time},
27 $author,
28 File::Basename::basename($yaml->{distribution}{build_dir}),
31 for my $t (sort { $a->[0] <=> $b->[0] } @history) {
32 printf "%s %-9s %s\n", scalar localtime $t->[0], $t->[1], $t->[2];