Replace the remaining bad urls with accsessible ones

Now all urls we use in our provided lyx-files
(doc, examples, templates)
use urls which really exist.

(If a url was meant merely as an example,
it was not touched, but added to file 'knownInvalidURLS'.)
This commit is contained in:
Kornel Benko 2013-08-30 17:28:46 +02:00
parent 9425f9ddd7
commit abe7eef13c
9 changed files with 35 additions and 25 deletions

View File

@ -1,5 +1,2 @@
#Net::HTTP: Bad hostname 'math.tulane.edu' # No entry here means, there are no inaccessible
http://math.tulane.edu/~entcs/ # urls used in our lyx-source
# not found
ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf
ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguide.pdf

View File

@ -40,8 +40,9 @@ BEGIN {
use CheckURL; use CheckURL;
$ENV{LANG} = "en"; $ENV{LC_ALL} = "en_US.UTF-8";
$ENV{LANGUAGE} = "en"; $ENV{LANG} = "en_US.UTF-8";
$ENV{LANGUAGE} = "en_US.UTF-8";
my %URLS = (); my %URLS = ();
my %ignoredURLS = (); my %ignoredURLS = ();
@ -87,14 +88,14 @@ my $errorcount = 0;
my $URLScount = 0; my $URLScount = 0;
for my $u (@urls) { for my $u (@urls) {
if (defined($selectedURLS{$u})) {
${selectedURLS}{$u}->{count} += 1;
}
if (defined($ignoredURLS{$u})) { if (defined($ignoredURLS{$u})) {
$ignoredURLS{$u} += 1; $ignoredURLS{$u}->{count} += 1;
next; next;
} }
next if ($checkSelectedOnly && ! defined(${selectedURLS}{$u})); next if ($checkSelectedOnly && ! defined($selectedURLS{$u}));
if (defined(${selectedURLS}{$u})) {
${selectedURLS}{$u} += 1;
}
$URLScount++; $URLScount++;
print "Checking '$u'"; print "Checking '$u'";
my $res = &check_url($u); my $res = &check_url($u);
@ -130,8 +131,11 @@ for my $u (@urls) {
} }
} }
&printNotUsedURLS("Ignored", \%ignoredURLS); if (%URLS) {
&printNotUsedURLS("Selected", \%selectedURLS); &printNotUsedURLS("Ignored", \%ignoredURLS);
&printNotUsedURLS("Selected", \%selectedURLS);
&printNotUsedURLS("KnownInvalid", \%extraURLS);
}
print "\n$errorcount URL-tests failed out of $URLScount\n\n"; print "\n$errorcount URL-tests failed out of $URLScount\n\n";
exit($errorcount); exit($errorcount);
@ -143,8 +147,13 @@ sub printNotUsedURLS($$)
my ($txt, $rURLS) = @_; my ($txt, $rURLS) = @_;
my @msg = (); my @msg = ();
for my $u ( sort keys %{$rURLS}) { for my $u ( sort keys %{$rURLS}) {
if ($rURLS->{$u} < 2) { if ($rURLS->{$u}->{count} < 2) {
push(@msg, $u); my @submsg = ();
for my $f (sort keys %{$rURLS->{$u}}) {
next if ($f eq "count");
push(@submsg, "$f:" . $rURLS->{$u}->{$f});
}
push(@msg, "\n $u\n " . join("\n ", @submsg) . "\n");
} }
} }
if (@msg) { if (@msg) {
@ -157,11 +166,15 @@ sub readUrls($$)
my ($file, $rUrls) = @_; my ($file, $rUrls) = @_;
die("Could not read file $file") if (! open(ULIST, $file)); die("Could not read file $file") if (! open(ULIST, $file));
my $line = 0;
while (my $l = <ULIST>) { while (my $l = <ULIST>) {
$line++;
$l =~ s/[\r\n]+$//; # remove eol $l =~ s/[\r\n]+$//; # remove eol
$l =~ s/\s*\#.*$//; # remove comment $l =~ s/\s*\#.*$//; # remove comment
next if ($l eq ""); next if ($l eq "");
$rUrls->{$l} = 1; if (! defined($rUrls->{$l} )) {
$rUrls->{$l} = {$file => $line, count => 1};
}
} }
close(ULIST); close(ULIST);
} }
@ -169,7 +182,7 @@ sub readUrls($$)
sub parse_file($) sub parse_file($)
{ {
my($f) = @_; my($f) = @_;
my $status = "out"; # outside of URL my $status = "out"; # outside of URL/href
return if ($f =~ /\/attic\//); return if ($f =~ /\/attic\//);
if(open(FI, $f)) { if(open(FI, $f)) {

View File

@ -45217,7 +45217,7 @@ Documentation of the LaTeX-package
\begin_inset CommandInset href \begin_inset CommandInset href
LatexCommand href LatexCommand href
name "KOMA-Script" name "KOMA-Script"
target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf" target "http://mirror.ctan.org/macros/latex/contrib/koma-script/scrguien.pdf"
\end_inset \end_inset

View File

@ -2700,7 +2700,7 @@ status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
http://math.tulane.edu/~entcs/ http://www.entcs.org/generic.zip
\end_layout \end_layout
\end_inset \end_inset

View File

@ -45273,7 +45273,7 @@ Dokumentation des LaTeX-Pakets
\begin_inset CommandInset href \begin_inset CommandInset href
LatexCommand href LatexCommand href
name "KOMA-Script" name "KOMA-Script"
target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguide.pdf" target "http://mirror.ctan.org/macros/latex/contrib/koma-script/scrguien.pdf"
\end_inset \end_inset

View File

@ -44579,7 +44579,7 @@ Documentación del paquete LaTeX
\begin_inset CommandInset href \begin_inset CommandInset href
LatexCommand href LatexCommand href
name "KOMA-Script" name "KOMA-Script"
target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf" target "http://mirror.ctan.org/macros/latex/contrib/koma-script/scrguien.pdf"
\end_inset \end_inset

View File

@ -46371,7 +46371,7 @@ Documentation du paquetage LaTeX
\begin_inset CommandInset href \begin_inset CommandInset href
LatexCommand href LatexCommand href
name "KOMA-Script" name "KOMA-Script"
target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf" target "http://mirror.ctan.org/macros/latex/contrib/koma-script/scrguien.pdf"
\end_inset \end_inset

View File

@ -41721,7 +41721,7 @@ LaTeXパッケージ
\begin_inset CommandInset href \begin_inset CommandInset href
LatexCommand href LatexCommand href
name "KOMA-script" name "KOMA-script"
target "ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/koma-script/scrguien.pdf" target "http://mirror.ctan.org/macros/latex/contrib/koma-script/scrguien.pdf"
\end_inset \end_inset

View File

@ -2439,7 +2439,7 @@ status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
http://math.tulane.edu/~entcs/ http://www.entcs.org/generic.zip
\end_layout \end_layout
\end_inset \end_inset