+
+sub search_unused_htmlfiles {
+ my @unscanned_dirs = ('../../templates/webpages');
+
+ while (scalar @unscanned_dirs) {
+ my $dir = shift @unscanned_dirs;
+
+ foreach my $entry (<$dir/*>) {
+ if (-d $entry) {
+ push @unscanned_dirs, $entry;
+
+ } elsif (($entry =~ /_master.html$/) && -f $entry && !$referenced_html_files{$entry}) {
+ print "W: unused HTML template: " . strip_base($entry) . "\n";
+
+ }
+ }
+ }
+}
+
+sub search_translated_htmlfiles_wo_master {
+ my @unscanned_dirs = ('../../templates/webpages');
+
+ while (scalar @unscanned_dirs) {
+ my $dir = shift @unscanned_dirs;
+
+ foreach my $entry (<$dir/*>) {
+ if (-d $entry) {
+ push @unscanned_dirs, $entry;
+
+ } elsif (($entry =~ /_[a-z]+\.html$/) && ($entry !~ /_master.html$/) && -f $entry) {
+ my $master = $entry;
+ $master =~ s/[a-z]+\.html$/master.html/;
+ if (! -f $master) {
+ print "W: translated HTML template without master: " . strip_base($entry) . "\n";
+ }
+ }
+ }
+ }
+}
+
+sub strip_base {
+ my $s = "$_[0]"; # Create a copy of the string.
+
+ $s =~ s|^../../||;
+ $s =~ s|templates/webpages/||;
+
+ return $s;
+}