summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Maischein <corion@corion.net>2012-03-10 17:28:08 +0100
committerRicardo Signes <rjbs@cpan.org>2012-03-12 17:14:00 -0400
commite8097ff21716361661e6a00312ab7b5a8a451efe (patch)
treed91ea0104bb4669a68fac85f51be54de2f7d9f22
parent0d36d0d16019b19d12916066a99b75d5a59dd3dd (diff)
downloadperl-e8097ff21716361661e6a00312ab7b5a8a451efe.tar.gz
load Algorithm::Diff later in corelist-perldelta
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);