From: bangerth Date: Mon, 26 Apr 2010 19:16:35 +0000 (+0000) Subject: Ignore https links just as we do http. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=485c52a08bbf6b66c943de1b08fcde4c86c18714;p=dealii-svn.git Ignore https links just as we do http. git-svn-id: https://svn.dealii.org/trunk@21043 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/scripts/validate-xrefs.pl b/deal.II/common/scripts/validate-xrefs.pl index 5a361e7b57..56659a9312 100644 --- a/deal.II/common/scripts/validate-xrefs.pl +++ b/deal.II/common/scripts/validate-xrefs.pl @@ -1,5 +1,5 @@ # $Id$ -# Check whether references in HTML files are valid or +# Check whether references in HTML files are valid or # point to non-existing files/links/etc # # Author: Wolfgang Bangerth, Guido Kanschat 2000, 2004 @@ -12,23 +12,23 @@ chop $startdir; foreach $filename (@ARGV) { - chdir $startdir || die "Could not change dir to $startdir\n"; + chdir $startdir || die "Could not change dir to $startdir\n"; open IN, $filename or die "---Can't open file `$filename'\n"; - + print "File: $filename\n" if $debug; if ($filename =~ m!(.+)/([^/]+)!) { chdir $1; $filename = $2; } - + while () { # save the entire line for simpler grepping when an error # occurs $this_line = $_; - # if line ends with an = character, the concatenate it with the next + # if line ends with an = character, the concatenate it with the next # one while ( /=\s*$/ ) { $newline = ; @@ -39,22 +39,22 @@ foreach $filename (@ARGV) # first find all hrefs while ( /<\s*a\s+href=\"?(.*?)[\s\"]/gi ) { - # then decide whether they are relevant for + # then decide whether they are relevant for # our purpose $link = $1; - - if ( $link =~ /^mailto|http:\/\//i ) { + + if ( $link =~ /^mailto|http(s)?:\/\//i ) { # link is external. don't check it print "external link: $link\n" if $debug; next; } elsif ( $link =~ m/^#(.*)/ ) { - # this is a reference within this file. try to + # this is a reference within this file. try to # find its anchor $internal_ref = $1; print "internal reference: $link\n" if $debug; - + open IN2, $filename; $found = 0; while ( ) { @@ -66,24 +66,24 @@ foreach $filename (@ARGV) } } } - + die "---Internal reference `$internal_ref' not found in file $filename\n This line is: $this_line.\n" unless $found; next; } elsif ( $link =~ /^(.*?)#(.*)/ ) { - # this is a reference within another file. try to + # this is a reference within another file. try to # find its anchor $external_file = $1; $external_ref = $2; - # if the file name was prepended with http: (but is a local file, + # if the file name was prepended with http: (but is a local file, # so no double-slash), then split off http: - $external_file =~ s/^http://g; + $external_file =~ s/^http(s)?://g; print "external reference: $link\n" if $debug; - + open IN2, $external_file; $found = 0; while ( ) { @@ -95,7 +95,7 @@ foreach $filename (@ARGV) } } } - + die "---External reference `$external_file#$external_ref' not found in file $filename\n This line is: $this_line.\n" unless $found; next; @@ -104,9 +104,9 @@ foreach $filename (@ARGV) # this must now be a regular file which is # referenced. the file must be local - # if the file name was prepended with http: (but is a local file, + # if the file name was prepended with http: (but is a local file, # so no double-slash), then split off http: - $link =~ s/^http://g; + $link =~ s/^http(s)?://g; die "---Local file `$link' not found in file `$filename'\n This line is: $this_line.\n" unless ((-r $link) && (-f $link));