Skip to content
Snippets Groups Projects
Commit 202b133f authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added progress output in STDERR

- added misc_ref to give context for report
parent 4fb6f19b
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ use v5.36;
use SLUB::LZA::TA::Archivematica::Elasticsearch;
use SLUB::LZA::TA::Output;
use Archive::BagIt;
use Date::Calc qw(Today);
use File::Find;
use namespace::autoclean;
# VERSION
......@@ -56,6 +57,7 @@ sub execute {
and ($File::Find::prune = 1)
and push @candidates, $File::Find::name;
};
say STDERR "scanning volumes: ".join(" ", @{ $SLUB::LZA::TA::config{permanent_volume} });
File::Find::find(
{wanted => $wanted},
@{ $SLUB::LZA::TA::config{permanent_volume} }
......@@ -73,7 +75,18 @@ sub execute {
$line;
} (sort @candidates);
my @headers = sort keys %{$results[0]};
my $misc_ref;
$misc_ref->{date} = sprintf("%04u-%02u-%02u", Today());
$misc_ref->{package} = __PACKAGE__;
my $volumes = "no volume found!";
if (exists($SLUB::LZA::TA::config{permanent_volume})) {
$volumes = join("\n", map {"* $_"} @{$SLUB::LZA::TA::config{permanent_volume}});
}
$misc_ref->{preface} = <<"PREFACE";
The following table contains the results of validating the AIPs of the volumes:
$volumes
PREFACE
if ($opt->{output_format} eq 'output_as_csv') {
SLUB::LZA::TA::Output::CSV::print_results(\@headers, \@results);
} elsif ($opt->{output_format} eq 'output_as_rsv') {
......@@ -81,9 +94,8 @@ sub execute {
} elsif ($opt->{output_format} eq 'output_as_raw') {
SLUB::LZA::TA::Output::Raw::print_results(\@results);
} else {
SLUB::LZA::TA::Output::Asciidoc::print_results(\@headers, \@results);
SLUB::LZA::TA::Output::Asciidoc::print_results(\@headers, \@results, $misc_ref);
}
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment