From 291c64f4c0f01fdef1479446cf0ba1ec265227d5 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 13 Jun 2009 11:34:34 +0100 Subject: Make perlmodlib.PL chdir into pod. Add a -q flag to suppress routine warnings. --- pod/perlmodlib.PL | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL index 51828c67f5..0a75208f83 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; } -- cgit v1.2.1