summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Maischein <corion@corion.net>2012-03-10 17:28:08 +0100
committerMax Maischein <corion@corion.net>2012-03-10 17:28:08 +0100
commite4e9c4d1cb029c94edde5221953146fcce659ec0 (patch)
tree6273b07ed86aa8f04bbd814202640f4885575c46
parentacdbe25bd91bf897e0cf373b91ab0814e21c4860 (diff)
downloadperl-corelist-rework.tar.gz
Move the requirement for Algorithm::Diff down to where the module is actually neededcorelist-rework
corelist-perldelta.pl is a bit schizophrenic. The part to generate the new Perldelta text does not need Algorithm::Diff, but wants to be run with the freshly built Perl. Ideally, the two usages get clarified and split up into two separate programs. The added documentation tries to give two helpful usages of the program.
-rwxr-xr-xPorting/corelist-perldelta.pl25
1 files changed, 24 insertions, 1 deletions
diff --git a/Porting/corelist-perldelta.pl b/Porting/corelist-perldelta.pl
index 15b63f1175..44b6ea7ddc 100755
--- a/Porting/corelist-perldelta.pl
+++ b/Porting/corelist-perldelta.pl
@@ -6,7 +6,29 @@ use lib 'Porting';
use Maintainers qw/%Modules/;
use Module::CoreList;
use Getopt::Long;
-require Algorithm::Diff;
+
+=head1 USAGE
+
+ # generate the module changes for the Perl you are currently building
+ ./perl Porting/corelist-perldelta.pl
+
+ # generate a diff between the corelist sections of two perldelta* files:
+ perl Porting/corelist-perldelta.pl --mode=check 5.17.1 5.17.2 <perl5172delta.pod
+
+=head1 ABOUT
+
+corelist-perldelta.pl is a bit schizophrenic. The part to generate the
+new Perldelta text does not need Algorithm::Diff, but wants to be
+run with the freshly built Perl.
+
+The part to check the diff wants to be run with a Perl that has an up-to-date
+L<Module::CoreList>, but needs the outside L<Algorithm::Diff>.
+
+Ideally, the program will be split into two separate programs, one
+to generate the text and one to show the diff between the
+corelist sections of the last perldelta and the next perldelta.
+
+=cut
my %sections = (
new => qr/New Modules and Pragma(ta)?/,
@@ -158,6 +180,7 @@ sub do_check {
printf $ck->[0] . ":\n";
+ require Algorithm::Diff;
my $diff = Algorithm::Diff->new(map {
[map { join q{ } => grep defined, @{ $_ } } @{ $_ }]
} \@delta, \@corelist);