Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13313: More forgiving error reporting
If topic meta is missing the date,  the perl was failing with a warning.
Check the dates are numeric before comparing them.

Print the error message about missing attachment meta if either validating or
verbose.
  • Loading branch information
gac410 committed Mar 24, 2015
1 parent 16c965d commit f6936bd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/tools/change_store.pl
Expand Up @@ -99,8 +99,14 @@ sub validate_info {
print STDERR
"$sp: Authors differ: $source->{author} and $target->{author}\n"
unless $source->{author} eq $target->{author};
print STDERR "$sp: Dates differ: $source->{date} and $target->{date}\n"
unless $source->{date} == $target->{date};
if ( $source->{date} =~ m/^\d+$/ && $target->{date} =~ m/^\d+$/ ) {
print STDERR "$sp: Dates differ: $source->{date} and $target->{date}\n"
unless $source->{date} == $target->{date};
}
else {
print STDERR
"$sp: non-decimal or missing dates ($source->{date}) and ($target->{date})\n";
}
}

my $session = new Foswiki();
Expand Down Expand Up @@ -343,7 +349,7 @@ sub validate_info {
# If the attachment is missing from the "top rev",
# report the file as it may be valuable.
print "NO META FOR ATTACHMENT: File not copied! "
if ($verbose);
if ( $verbose || $validate );
print "$top_name/$att_name\n";
next;
}
Expand Down

0 comments on commit f6936bd

Please sign in to comment.