--- foxridge-archiver/metacheck.pl 2005/09/20 17:24:57 1.4 +++ foxridge-archiver/metacheck.pl 2017/03/16 17:00:43 1.6 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w use strict; use XML::LibXML; @@ -184,8 +184,13 @@ sub check_dirs { my $description = sstrip($dirnode->find('child::description')); # name must be valid if (! valid_dir_name($dirname)) { - logger("ERROR", "directory name ($dirpath) $dirname invalid!"); - $errcnt++; + if ($do_rewrite) { + logger("WARNING", "directory name ($dirpath) $dirname in index file invalid!"); + $warncnt++; + } else { + logger("ERROR", "directory name ($dirpath) $dirname invalid!"); + $errcnt++; + } } # description can be present if (! $description) { @@ -274,8 +279,13 @@ sub check_files { my $filedate = sstrip($filenode->find('child::date')); # name must be valid if (! valid_file_name($filename)) { - logger("ERROR", "file name ($filepath)$filename invalid!"); - $errcnt++; + if ($do_rewrite) { + logger("WARNING", "file name ($filepath)$filename in index file invalid!"); + $warncnt++; + } else { + logger("ERROR", "file name ($filepath)$filename invalid!"); + $errcnt++; + } } my $fn = ($filepath) ? "$filepath/$filename" : "$filename"; #logger("file: \"$filename\", \"$filepath\"");