X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fcheckpods.PL;h=1466fb94d3d644334dc01e76c4ac2277adbe6939;hb=bc82975d259d743626ad1b4a960b4b1f13c7a816;hp=0cac62325e5778fbed02b64a28a289814774dbdf;hpb=2862e1b7fc64694815faab42fc50219a12dae9f0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/checkpods.PL b/pod/checkpods.PL index 0cac623..1466fb9 100644 --- a/pod/checkpods.PL +++ b/pod/checkpods.PL @@ -2,6 +2,7 @@ use Config; use File::Basename qw(&basename &dirname); +use Cwd; # List explicitly here the variables you want Configure to # generate. Metaconfig only looks for shell variables, so you @@ -12,6 +13,7 @@ use File::Basename qw(&basename &dirname); # This forces PL files to create target in same directory as PL file. # This is so that make depend always knows where to find PL derivatives. +$origdir = cwd; chdir dirname($0); $file = basename($0, '.PL'); $file .= '.com' if $^O eq 'VMS'; @@ -46,7 +48,7 @@ print OUT <<'!NO!SUBS!'; # problem currently exists. # # Version 1.00 Original. -# Version 1.01 Andy Dougherty +# Version 1.01 Andy Dougherty # Trivial modifications to output format for easier auto-parsing # Broke it out as a separate function to avoid nasty # Make/Shell/Perl quoting problems, and also to make it easier @@ -62,9 +64,9 @@ print OUT <<'!NO!SUBS!'; $exit = $last_unempty = 0; while (<>) { - chomp; + s/(\012|\015\012|\015)$//; if (/^=(\S+)/ && $directive{$1} && $last_unempty) { - printf "%s: line %5d, no blank line preceeding directive =%s\n", + printf "%s: line %5d, no blank line preceding directive =%s\n", $ARGV, $., $1; $exit = 1; } @@ -80,3 +82,4 @@ exit $exit close OUT or die "Can't close $file: $!"; chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; +chdir $origdir;