changeset 24:1dd183b95c61

-replace deals with invalid filenames in index files now
author casties
date Tue, 04 Oct 2005 16:36:32 +0200
parents a3c35eae25dc
children 8b9d91963de7
files metacheck.pl
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/metacheck.pl	Fri Sep 23 19:16:17 2005 +0200
+++ b/metacheck.pl	Tue Oct 04 16:36:32 2005 +0200
@@ -184,8 +184,13 @@
 	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 @@
 	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\"");