perl/modules/W3C/LinkChecker/bin checklink,4.118,4.119 checklink.pod,1.19,1.20

Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv5871

Modified Files:
	checklink checklink.pod 
Log Message:
Allow --exclude-docs be specified multiple times, based on patch from Michael Ernst.

Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.118
retrieving revision 4.119
diff -u -d -r4.118 -r4.119
--- checklink	17 Oct 2008 04:36:19 -0000	4.118
+++ checklink	25 Oct 2008 19:22:46 -0000	4.119
@@ -369,7 +369,7 @@
     Password          => undef,
     Base_Locations    => [],
     Exclude           => undef,
-    Exclude_Docs      => undef,
+    Exclude_Docs      => [],
     Masquerade        => 0,
     Masquerade_From   => '',
     Masquerade_To     => '',
@@ -401,8 +401,8 @@
   eval { $Opts{Exclude} = qr/$Opts{Exclude}/o; };
   &usage(1, "Error in exclude regexp: $@") if $@;
 }
-if (defined($Opts{Exclude_Docs})) {
-  eval { $Opts{Exclude_Docs} = qr/$Opts{Exclude_Docs}/o; };
+for my $i (0 .. $#{$Opts{Exclude_Docs}}) {
+  eval { $Opts{Exclude_Docs}->[$i] = qr/$Opts{Exclude_Docs}->[$i]/; };
   &usage(1, "Error in exclude-docs regexp: $@") if $@;
 }
 if (defined($Opts{Trusted})) {
@@ -615,8 +615,8 @@
              'r|recursive'     => sub { $Opts{Depth} = -1
                                           if $Opts{Depth} == 0; },
              'l|location=s'    => \@locs,
-             'X|exclude=s',    => \$Opts{Exclude},
-             'exclude-docs=s', => \$Opts{Exclude_Docs},
+             'X|exclude=s'     => \$Opts{Exclude},
+             'exclude-docs=s@' => \$Opts{Exclude_Docs},
              'u|user=s'        => \$Opts{User},
              'p|password=s'    => \$Opts{Password},
              't|timeout=i'     => \$Opts{Timeout},
@@ -698,7 +698,8 @@
                             match REGEXP; also limits recursion the same way
                             as --exclude-docs with the same regexp would.
  --exclude-docs REGEXP      In recursive mode, do not check links in documents
-                            whose full, canonical URIs match REGEXP.
+                            whose full, canonical URIs match REGEXP.  This
+                            option may be specified multiple times.
  -L, --languages LANGS      Accept-Language header to send.  The special value
                             'auto' causes autodetection from the environment.
  -R, --no-referer           Do not send the Referer HTTP header.
@@ -1202,9 +1203,11 @@
 
   my $candidate = URI->new($uri)->canonical();
 
-  return 0
-      if ((defined($Opts{Exclude}) && $candidate =~ $Opts{Exclude}) ||
-          (defined($Opts{Exclude_Docs}) && $candidate =~ $Opts{Exclude_Docs}));
+  return 0 if (defined($Opts{Exclude}) && $candidate =~ $Opts{Exclude});
+
+  for my $excluded_doc (@{$Opts{Exclude_Docs}}) {
+    return 0 if ($candidate =~ $excluded_doc);
+  }
 
   foreach my $base (@{$Opts{Base_Locations}}) {
     my $rel = $candidate->rel($base);

Index: checklink.pod
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink.pod,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- checklink.pod	10 Feb 2008 13:17:03 -0000	1.19
+++ checklink.pod	25 Oct 2008 19:22:46 -0000	1.20
@@ -77,7 +77,7 @@
 =item B<--exclude-docs> I<regexp>
 
 In recursive mode, do not check links in documents whose full, canonical
-URIs match I<regexp>.
+URIs match I<regexp>.  This option may be specified multiple times.
 
 =item B<-L, --languages> I<accept-language>
 

Received on Saturday, 25 October 2008 19:22:58 UTC