Change 18402 by jhi@lyta on 2003/01/03 02:47:18
[PATCH Pod::Checker] Decouple podchecker program and function
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Tue, 10 Dec 2002 15:25:02 -0800
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PATCH Pod::Checker] Decouple podchecker program and function
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Tue, 10 Dec 2002 15:40:05 -0800
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.8/perl/lib/Pod/Checker.pm#3 edit
... //depot/maint-5.8/perl/pod/podchecker.PL#2 edit
... //depot/maint-5.8/perl/t/pod/poderrs.xr#3 edit
Differences ...
==== //depot/maint-5.8/perl/lib/Pod/Checker.pm#3 (text) ====
Index: perl/lib/Pod/Checker.pm
--- perl/lib/Pod/Checker.pm#2~18227~ Mon Dec 2 05:23:48 2002
+++ perl/lib/Pod/Checker.pm Thu Jan 2 18:47:18 2003
@@ -739,7 +739,6 @@
## print the number of errors found
my $self = shift;
my $infile = $self->input_file();
- my $out_fh = $self->output_handle();
if(@{$self->{_list_stack}}) {
# _TODO_ display, but don't count them for now
@@ -790,19 +789,7 @@
-msg => "multiple occurrence of link target '$_'"});
}
- ## Print the number of errors found
- my $num_errors = $self->num_errors();
- if ($num_errors > 0) {
- printf $out_fh ("$infile has $num_errors pod syntax %s.\n",
- ($num_errors == 1) ? "error" : "errors");
- }
- elsif($self->{_commands} == 0) {
- print $out_fh "$infile does not contain any pod commands.\n";
- $self->num_errors(-1);
- }
- else {
- print $out_fh "$infile pod syntax OK.\n";
- }
+ $self->num_errors(-1) if $self->{_commands} == 0;
}
# check a POD command directive
==== //depot/maint-5.8/perl/pod/podchecker.PL#2 (text) ====
Index: perl/pod/podchecker.PL
--- perl/pod/podchecker.PL#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/pod/podchecker.PL Thu Jan 2 18:47:18 2003
@@ -148,22 +148,30 @@
## Invoke podchecker()
my $status = 0;
@ARGV = qw(-) unless(@ARGV);
-for (@ARGV) {
- if($_ eq '-') {
- $_ = "<&STDIN";
+for my $podfile (@ARGV) {
+ if($podfile eq '-') {
+ $podfile = "<&STDIN";
}
- elsif(-d) {
- warn "podchecker: Warning: Ignoring directory '$_'\n";
+ elsif(-d $podfile) {
+ warn "podchecker: Warning: Ignoring directory '$podfile'\n";
next;
}
- my $s = podchecker($_, undef, '-warnings' => $options{warnings});
- if($s > 0) {
+ my $errors =
+ podchecker($podfile, undef, '-warnings' => $options{warnings});
+ if($errors > 0) {
# errors occurred
$status = 1;
+ printf STDERR ("%s has %d pod syntax %s.\n",
+ $podfile, $errors,
+ ($errors == 1) ? "error" : "errors");
}
- elsif($s < 0) {
+ elsif($errors < 0) {
# no pod found
$status = 2 unless($status);
+ print STDERR "$podfile does not contain any pod commands.\n";
+ }
+ else {
+ print STDERR "$podfile pod syntax OK.\n";
}
}
exit $status;
==== //depot/maint-5.8/perl/t/pod/poderrs.xr#3 (text) ====
Index: perl/t/pod/poderrs.xr
--- perl/t/pod/poderrs.xr#2~18227~ Mon Dec 2 05:23:48 2002
+++ perl/t/pod/poderrs.xr Thu Jan 2 18:47:18 2003
@@ -46,4 +46,3 @@
*** ERROR: unresolved internal link 'abc def' at line 114 in file t/pod/poderrs.t
*** ERROR: unresolved internal link 'I/O Operators' at line 202 in file
t/pod/poderrs.t
*** WARNING: multiple occurrence of link target 'Misc' at line - in file
t/pod/poderrs.t
-t/pod/poderrs.t has 34 pod syntax errors.
End of Patch.