diff options
author | Ricardo Signes <rjbs@cpan.org> | 2012-09-17 11:55:03 -0400 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2012-09-18 12:59:41 -0400 |
commit | 8ed35a78b521ab48e2c7149869057e144891f1fd (patch) | |
tree | 9f150e577d0a0f326f3bff9f93edcfaf6a93b82b /Porting/perlhist_calculate.pl | |
parent | bd4ce90752c011156eedb0f4d266d86e09b633f3 (diff) | |
download | perl-8ed35a78b521ab48e2c7149869057e144891f1fd.tar.gz |
make perlhist_calculate.pl emit ready-to-use text
format the data for the line in a line (and right now that line matches
up with the lines in the current table)
format the table in a table so that you can block-select it and paste
into the file
the last two edits were done by hand, which was a drag
Diffstat (limited to 'Porting/perlhist_calculate.pl')
-rwxr-xr-x | Porting/perlhist_calculate.pl | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/Porting/perlhist_calculate.pl b/Porting/perlhist_calculate.pl index 55a4ce36ee..8cbc3d9ecb 100755 --- a/Porting/perlhist_calculate.pl +++ b/Porting/perlhist_calculate.pl @@ -9,6 +9,12 @@ use File::Find; use warnings; use strict; +sub emit { + my $H = '%-9s:'; + my $D = '%6d'; + printf "$H $D $D\n", @_; +} + sub calc_core { my @core; @@ -24,7 +30,7 @@ sub calc_core { my $corenumber = scalar @core; $coresize = int $coresize; - say "core: $coresize $corenumber"; + return $coresize, $corenumber; } sub calc_lib { @@ -40,7 +46,7 @@ sub calc_lib { find(\&wanted_lib, 'lib'); $libsize = int $libsize; - say "lib: $libsize $libnumber"; + return $libsize, $libnumber; } sub calc_ext { @@ -61,7 +67,7 @@ sub calc_ext { $extsize = int $extsize; - say "ext: $extsize $extnumber"; + return $extsize, $extnumber; } sub calc_t { @@ -78,7 +84,7 @@ sub calc_t { $tsize = int $tsize; - say "t: $tsize $tnumber"; + return $tsize, $tnumber; } sub calc_doc { @@ -105,7 +111,7 @@ sub calc_doc { $docsize = int $docsize; - say "doc: $docsize $docnumber"; + return $docsize, $docnumber; } sub calc_dir { @@ -125,13 +131,13 @@ sub calc_dir { $dirsize = int $dirsize; - say "$dir: $dirsize $dirnumber"; + emit $dir => $dirsize, $dirnumber; } sub calc_longtable { - print "\n\nTable\n"; + print "\n\nTable:\n"; foreach my $dir (qw(beos)) { calc_dir($dir); @@ -139,7 +145,7 @@ sub calc_longtable { my $configure_size = int ((-s 'Configure') / 1000); - say "Configure: $configure_size 1"; + emit Configure => $configure_size, 1; foreach my $dir (qw(Cross djgpp emacs epoc h2pl hints mad mint mpeix NetWare os2 plan9 Porting qnx symbian utils vms vos win32 x2p)) { calc_dir($dir); @@ -149,11 +155,15 @@ sub calc_longtable { say "Selected release sizes for perl tarball:"; print "\n"; -calc_core(); -calc_lib(); -calc_ext(); -calc_t(); -calc_doc(); + #5.16.0 5562 109 1077 80 20504 2702 8750 2375 4815 152 + +sub calc_line { + printf " %-12s %6s %3s %6s %3s %6s %4s %6s %4s %6s %3s\n", + '5.xx.0', calc_core(), calc_lib(), calc_ext(), calc_t(), calc_doc(); +} + +calc_line(); + calc_longtable(); exit; |