From: Nicholas Clark Date: Sat, 13 Jun 2009 10:34:34 +0000 (+0100) Subject: Make perlmodlib.PL chdir into pod. Add a -q flag to suppress routine warnings. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=291c64f4c0f01fdef1479446cf0ba1ec265227d5;p=p5sagit%2Fp5-mst-13.2.git Make perlmodlib.PL chdir into pod. Add a -q flag to suppress routine warnings. --- diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL index 51828c6..0a75208 100644 --- a/pod/perlmodlib.PL +++ b/pod/perlmodlib.PL @@ -2,9 +2,17 @@ $ENV{LC_ALL} = 'C'; +use FindBin; +chdir $FindBin::Bin or die "$0: Can't chdir $FindBin::Bin: $!"; + +my $Quiet = @ARGV && $ARGV[0] eq '-q'; + open (OUT, ">perlmodlib.pod") or die $!; my (@pragma, @mod, @MANIFEST); +# MANIFEST itself is Unix style filenames, so we have to assume that Unix style +# filenames will work. + open (MANIFEST, "../MANIFEST") or die $!; @MANIFEST = grep !m, ; push @MANIFEST, 'lib/Config.pod', 'lib/Errno.pm', 'lib/lib.pm', @@ -55,7 +63,8 @@ for (@MANIFEST) { } } unless ($foundit) { - warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"; + warn "$filename missing =head1 NAME (OK if respective .pod exists)\n" + unless $Quiet; next; } my $title = ; @@ -76,7 +85,7 @@ for (@MANIFEST) { unless ($name and $thing) { warn "$filename missing name\n" unless $name; - warn "$filename missing thing\n" unless $thing; + warn "$filename missing thing\n" unless $thing or $Quiet; next; }