commandref_join.pl: speed up processing with "-noWarnings" (Forum #105079)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20690 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-12-08 17:10:14 +00:00
parent a4a001cde3
commit d953a14d87

View File

@ -173,9 +173,19 @@ generateModuleCommandref($$;$$)
} elsif(!$skip) { } elsif(!$skip) {
print $fh $l if($fh); print $fh $l if($fh);
if($l =~ m,INSERT_DOC_FROM: ([^ ]+)/([^ /]+) ,) {
my ($dir, $re) = ($1, $2);
if(opendir(DH, $dir)) {
foreach my $file (grep { m/^$2$/ } readdir(DH)) {
generateModuleCommandref("$dir/$file", $lang, $fh, 1);
}
closedir(DH);
}
}
chkAndGenLangLinks($l, $lang, $fh); chkAndGenLangLinks($l, $lang, $fh);
$docCount++; $docCount++;
next if($noWarnings);
$hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink); $hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink);
foreach $tag (TAGS) { foreach $tag (TAGS) {
if($l =~ m/<$tag ([^>]+)>/i) { if($l =~ m/<$tag ([^>]+)>/i) {
@ -194,15 +204,6 @@ generateModuleCommandref($$;$$)
$llwct{$tag} = $line if(!$tagcount{$tag}); $llwct{$tag} = $line if(!$tagcount{$tag});
} }
if($l =~ m,INSERT_DOC_FROM: ([^ ]+)/([^ /]+) ,) {
my ($dir, $re) = ($1, $2);
if(opendir(DH, $dir)) {
foreach my $file (grep { m/^$2$/ } readdir(DH)) {
generateModuleCommandref("$dir/$file", $lang, $fh, 1);
}
closedir(DH);
}
}
} }
} }
close($modFh); close($modFh);