Skip to content
Snippets Groups Projects
Commit 4938ed1f authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

start to deal with broken note files

parent 1c0ce15d
No related branches found
No related tags found
No related merge requests found
...@@ -99,6 +99,7 @@ print __LINE__, " scan_dir: quick=[$quick]\n"; ...@@ -99,6 +99,7 @@ print __LINE__, " scan_dir: quick=[$quick]\n";
$quick= 0; $quick= 0;
} }
my @broken= ();
my @res= (); my @res= ();
my ($cnt_added, $cnt_updated, $cnt_unchanged, $cnt_dropped)= (0, 0, 0, 0); my ($cnt_added, $cnt_updated, $cnt_unchanged, $cnt_dropped)= (0, 0, 0, 0);
NOTE: while (my $e= readdir (DIR)) NOTE: while (my $e= readdir (DIR))
...@@ -152,8 +153,10 @@ print __LINE__, " scan_dir: quick=[$quick]\n"; ...@@ -152,8 +153,10 @@ print __LINE__, " scan_dir: quick=[$quick]\n";
{ {
print "ATTN: parsing [$fp] returned undefined note!\n"; print "ATTN: parsing [$fp] returned undefined note!\n";
print "caller: ", join (' ', caller()), "\n"; print "caller: ", join (' ', caller()), "\n";
push (@broken, $fp);
next NOTE; next NOTE;
} }
# print "n: ", main::Dumper ($n); # print "n: ", main::Dumper ($n);
my %rec= map { $_ => $n->{$_} } @TB_note_attrs; my %rec= map { $_ => $n->{$_} } @TB_note_attrs;
...@@ -179,7 +182,14 @@ print __LINE__, " scan_dir: quick=[$quick]\n"; ...@@ -179,7 +182,14 @@ print __LINE__, " scan_dir: quick=[$quick]\n";
# TODO: save statistics and/or file status for later processing # TODO: save statistics and/or file status for later processing
print "statistics: cnt_added=$cnt_added cnt_updated=$cnt_updated cnt_dropped=$cnt_dropped cnt_unchanged=$cnt_unchanged\n"; my $cnt_broken= @broken;
print "statistics: cnt_added=$cnt_added cnt_updated=$cnt_updated cnt_dropped=$cnt_dropped cnt_unchanged=$cnt_unchanged cnt_broken=$cnt_broken\n";
if ($cnt_broken > 0)
{
print "\nbroken files:\n* ", join ("\n *", @broken), "\n";
}
(wantarray) ? @res : \@res; (wantarray) ? @res : \@res;
} }
......
...@@ -67,6 +67,7 @@ print main::Dumper ($self); ...@@ -67,6 +67,7 @@ print main::Dumper ($self);
my ($mode, $toc, $rows)= $self->load_toc(); my ($mode, $toc, $rows)= $self->load_toc();
my $toc_data= $tb_d->scan_dir ($note_dir, $rows, $mode); my $toc_data= $tb_d->scan_dir ($note_dir, $rows, $mode);
# print "toc_data=[$toc_data]\n";
# TODO: if verbose or so print "toc_data: ", Dumper ($toc_data); # TODO: if verbose or so print "toc_data: ", Dumper ($toc_data);
$toc->{'data'}= $toc_data; $toc->{'data'}= $toc_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment