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

- removed unused module

- add duration
- add dir size
- removed superflous ready message (flooding report)
parent 7a19bb10
Branches
Tags
No related merge requests found
...@@ -23,7 +23,6 @@ use feature qw(say); ...@@ -23,7 +23,6 @@ use feature qw(say);
use Carp; use Carp;
use Path::Tiny; use Path::Tiny;
use File::Find; use File::Find;
use File::Sort qw(sort_file);
use XML::LibXML; use XML::LibXML;
use Time::Progress; use Time::Progress;
use XML::LibXML::XPathContext; use XML::LibXML::XPathContext;
...@@ -296,6 +295,7 @@ if (defined $search_dir && -d "$search_dir") { ...@@ -296,6 +295,7 @@ if (defined $search_dir && -d "$search_dir") {
$stat->{IEs} = 0; $stat->{IEs} = 0;
$stat->{files} = 0; $stat->{files} = 0;
$stat->{errors} = 0; $stat->{errors} = 0;
$stat->{begin} = time;
while ( <$fh_unsorted_file>) { while ( <$fh_unsorted_file>) {
$stat->{IEs}++; $stat->{IEs}++;
chomp; chomp;
...@@ -319,14 +319,17 @@ if (defined $search_dir && -d "$search_dir") { ...@@ -319,14 +319,17 @@ if (defined $search_dir && -d "$search_dir") {
path($report_file)->append_utf8("\t$errors\n"); path($report_file)->append_utf8("\t$errors\n");
} }
$stat->{errors} += $result->{errors}; $stat->{errors} += $result->{errors};
} else {
path($report_file)->append_utf8("IE $_ is fine! :)\n");
} }
} }
# write report # write report
} }
say ""; say "";
say "Scanned $stat->{IEs} IEs with $stat->{files} files, found $stat->{errors} errors"; $stat->{end} = time;
$stat->{duration} = $stat->{end} - $stat->{begin};
$stat->{scansize} = `du -hs $search_dir`;
my $summary = "Scanned $stat->{IEs} IEs with $stat->{files} files ($stat->{scansize}) in $stat->{duration} seconds, found $stat->{errors} errors";
path($report_file)->append_utf8("$summary\n");
say $summary;
} else { } else {
die "no directory given on commandline"; die "no directory given on commandline";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment