W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

perl/modules/W3C/LinkChecker/bin checklink,4.150,4.151

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 26 Feb 2009 19:16:07 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LcliJ-0002WV-5d@lionel-hutz.w3.org>
Update of /sources/public/perl/modules/W3C/LinkChecker/bin
In directory hutz:/tmp/cvs-serv9683/bin

Modified Files:
	checklink 
Log Message:
Don't output informational messages in quiet mode (rt.cpan.org #43372).

Index: checklink
===================================================================
RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v
retrieving revision 4.150
retrieving revision 4.151
diff -u -d -r4.150 -r4.151
--- checklink	19 Feb 2009 21:05:38 -0000	4.150
+++ checklink	26 Feb 2009 19:16:04 -0000	4.151
@@ -1062,7 +1062,7 @@
           $broken{$u}{fragments}{$fragment} += 2;
         }
       }
-    } else {
+    } elsif (!($Opts{Quiet} && &informational($results{$u}{location}{code}))) {
       # Couldn't find the document
       $broken{$u}{location} = 1;
       # All the fragments associated are hence broken
@@ -1911,6 +1911,14 @@
   return "(N/A)";
 }
 
+# returns true if the given code is informational
+sub informational ($)
+{
+  my $rc = shift;
+  return $rc == RC_ROBOTS_TXT() || $rc == RC_IP_DISALLOWED() ||
+    $rc == RC_PROTOCOL_DISALLOWED();
+}
+
 sub anchors_summary (\%\%)
 {
   my ($anchors, $errors) = @_;
@@ -2399,8 +2407,7 @@
   my $r = HTTP::Response->new($code);
   if ($r->is_success()) {
     $icon_type = 'error'; # if is success but reported, it's because of broken frags => error
-  } elsif ($code == RC_ROBOTS_TXT() || $code == RC_IP_DISALLOWED() ||
-           $code == RC_PROTOCOL_DISALLOWED()) {
+  } elsif (&informational($code)) {
     $icon_type = 'info';
   } elsif ($code == 300) {
     $icon_type = 'info';
Received on Thursday, 26 February 2009 19:16:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:09 GMT