remove the separate method contains(), it does not offer enough sugar, just duplicatd...
[rersyncrecent.git] / bin / rrr-aggregate
blobf9903448d5f1ec89a9dba9ede931a18fcc19e0ae
1 #!/usr/bin/perl -- -*- mode: cperl -*-
3 =head1 NAME
5 rrr-aggregate - merge a set of recentfiles
7 =head1 SYNOPSIS
9 rrr-aggregate [options] file
11 =head1 OPTIONS
13 =over 8
15 =cut
17 my $optpod = <<'=back';
19 =item B<--dry-run!>
21 (TBD) Do not really run the command, ...
23 =item B<--help|h>
25 Prints a brief message and exists.
27 =item B<--locktimeout=s>
29 Sets the locktimeout. See L<File::Rsync::Mirror::Recentfile>.
31 =item B<--verbose|v+>
33 More feedback.
35 =back
37 =head1 DESCRIPTION
39 rersyncrecent is a project to get speedy rsync operation on large
40 trees over multiple hosts. It maintains a collection of files with
41 metadata (so called recentfiles) that represent adjacent or
42 overlapping timespans of file change events.
44 rrr-aggregate merges the recentfiles that describe a tree. The file
45 argument is the path to the principal (the shortest) in a collection
46 of recentfiles.
48 =cut
51 use strict;
52 use warnings;
54 use File::Rsync::Mirror::Recentfile;
55 use Getopt::Long;
56 use Pod::Usage qw(pod2usage);
58 our %Opt;
59 my @opt = $optpod =~ /B<--(\S+)>/g;
61 GetOptions(\%Opt,
62 @opt,
63 ) or pod2usage(2);
65 if ($Opt{help}) {
66 pod2usage(0);
69 if (! @ARGV) {
70 pod2usage(2);
73 if ($Opt{'dry-run'}) {
74 die "FIXME: not yet implemented";
77 my $rf = File::Rsync::Mirror::Recentfile->new_from_file($ARGV[0]);
78 if (my $tout = $Opt{locktimeout}) {
79 $rf->locktimeout($tout);
81 $rf->aggregate();
83 __END__
86 # Local Variables:
87 # mode: cperl
88 # coding: utf-8
89 # cperl-indent-level: 4
90 # End: