From 33a721380f05364f00e0dc772a63111aa8613a12 Mon Sep 17 00:00:00 2001 From: "Andreas J. Koenig" Date: Sun, 27 Jun 2010 11:35:05 +0200 Subject: [PATCH] flesh up the --verbose switch for rrr-init --- bin/rrr-init | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/rrr-init b/bin/rrr-init index 5a5a193..1baf56c 100644 --- a/bin/rrr-init +++ b/bin/rrr-init @@ -78,13 +78,22 @@ my $rf = File::Rsync::Mirror::Recentfile->new verbose => $Opt{verbose}, ); +my @t = time; my @batch; foreach my $file ( map {$_->[1]} sort {$a->[0] <=> $b->[0]} map {[-M $_, $_]} File::Find::Rule->new->file->in($rootdir) ) { my $path = File::Spec->rel2abs($file); my $epoch = (stat $path)[9]; push @batch, {path=>$path,type=>"new",epoch=>$epoch}; } +if ($Opt{verbose}) { + $t[1] = time; + warn sprintf "Found %d files to register in %.6f s. Writing to %s/%s\n", scalar @batch, $t[1]-$t[0], $rootdir, $rf->rfilename; +} $rf->batch_update(\@batch); +if ($Opt{verbose}) { + $t[2] = time; + warn sprintf "Registered %d files in %.6f s\n", scalar @batch, $t[2]-$t[1]; +} __END__ -- 2.11.4.GIT