diff options
author | James Bence <unknown> | 2008-04-16 15:22:12 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-04-18 12:43:27 +0000 |
commit | 4e42dfb1441e110bf697e136cebfeff74cf33d6f (patch) | |
tree | 7ea597c9925e8818477a23a018be6ba41f808038 /pod/perlmodlib.PL | |
parent | f6f3a1fea2bda9d33f9cc5367b630a21738c9def (diff) | |
download | perl-4e42dfb1441e110bf697e136cebfeff74cf33d6f.tar.gz |
[perl #53000] Patch for featured TODO: make a reproducible perlmodlib.PL
From: "James Bence" (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-23612-1208409731-470.53000-75-0@perl.org>
plus regen perlmodlib (from a clean source tree)
and remove perltodo note
p4raw-id: //depot/perl@33711
Diffstat (limited to 'pod/perlmodlib.PL')
-rw-r--r-- | pod/perlmodlib.PL | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL index b7e5bf3a18..39e9613295 100644 --- a/pod/perlmodlib.PL +++ b/pod/perlmodlib.PL @@ -10,36 +10,57 @@ open (MANIFEST, "../MANIFEST") or die $!; push @MANIFEST, 'lib/Config.pod', 'lib/Errno.pm', 'lib/lib.pm', 'lib/DynaLoader.pm', 'lib/XSLoader.pm'; --f "../lib/DynaLoader.pm" or die "Must be run from a source tree where perl has been built\n"; +# If run in a clean source tree, these will be missing because they are +# generated by the build. +my %generated = ( + 'encoding' => 'Allows you to write your script in non-ascii or non-utf8', + 'lib' => 'Manipulate @INC at compile time', + 'ops' => 'Restrict unsafe operations when compiling', + 'Config' => 'Access Perl configuration information', + 'DynaLoader' => 'Dynamically load C libraries into Perl code', + 'Errno' => 'System errno constants', + 'O' => 'Generic interface to Perl Compiler backends', + 'Safe' => 'Compile and execute code in restricted compartments', + 'XSLoader' => 'Dynamically load C libraries into Perl code', +); + +# If run in a clean source tree, these should not be reported. +# These are considered 'modules' by this script, but they really are not. +my %suppressed = map {$_ => 1} qw( + B::O + Encode::encoding + Opcode::Safe + Opcode::ops +); for (@MANIFEST) { - my $filename; - next unless s|^lib/|| or m|^ext/|; - my ($origfilename) = ($filename) = m|^(\S+)|; - $filename =~ s|^[^/]+/|| if $filename =~ s|^ext/||; - next unless $filename =~ m!\.p(m|od)$!; - unless (open (MOD, "../lib/$filename")) { - unless (open (MOD, "../$origfilename")) { - warn "Couldn't open ../$origfilename: $!"; - next; - } - $filename = $origfilename; - } + my $filename; + next unless s|^lib/|| or m|^ext/|; + my ($origfilename) = ($filename) = m|^(\S+)|; + $filename =~ s|^[^/]+/|| if $filename =~ s|^ext/||; + next unless $filename =~ m!\.p(m|od)$!; + unless (open (MOD, "../lib/$filename")) { + unless (open (MOD, "../$origfilename")) { + warn "Couldn't open ../$origfilename: $!"; + next; + } + $filename = $origfilename; + } my ($name, $thing); my $foundit=0; { - local $/=""; - while (<MOD>) { - next unless /^=head1 NAME/; - $foundit++; - last; - } + local $/=""; + while (<MOD>) { + next unless /^=head1 NAME/; + $foundit++; + last; + } } unless ($foundit) { - warn "$filename missing =head1 NAME (okay if there is respective .pod)\n"; - next; + warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"; + next; } my $title = <MOD>; chomp($title); @@ -57,11 +78,12 @@ for (@MANIFEST) { ($name, $thing) = split / --? /, $title, 2; unless ($name and $thing) { - warn "$filename missing name\n" unless $name; - warn "$filename missing thing\n" unless $thing; - next; + warn "$filename missing name\n" unless $name; + warn "$filename missing thing\n" unless $thing; + next; } + next if $suppressed{$perlname}; $thing =~ s/^perl pragma to //i; $thing = ucfirst($thing); @@ -72,6 +94,17 @@ for (@MANIFEST) { } else { push @pragma, $title; } + + # if we find a generated one via the MANIFEST, no need to add later. + delete $generated{$perlname}; +} +while (my ($name,$desc) = each %generated) { + my $title = "=item $name\n\n$desc\n\n"; + if ($name =~ /[A-Z]/) { + push @mod, $title; + } else { + push @pragma, $title; + } } print OUT <<'EOF'; |