fold duplicates into one line
[andk-cpan-tools.git] / bin / call-analoep.pl
blob21b7dc87bd198abb3137ccee7f8ec40cc8866538
1 #!/usr/bin/perl
3 # use 5.010;
4 use strict;
5 use warnings;
7 =head1 NAME
11 =head1 SYNOPSIS
15 =head1 OPTIONS
17 =over 8
19 =cut
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
23 =item B<--help|h!>
25 This help
27 =item B<--onlytar!>
29 Skip the run(s) with I<--focus != tar>
31 =back
33 =head1 DESCRIPTION
35 Calls bin/analysis-oldreports-extinction-program.pl several times with our favorite parameters
37 =cut
40 use FindBin;
41 use lib "$FindBin::Bin/../lib";
42 BEGIN {
43 push @INC, qw( );
46 use Dumpvalue;
47 use File::Basename qw(dirname);
48 use File::Path qw(mkpath);
49 use File::Spec;
50 use File::Temp;
51 use Getopt::Long;
52 use Pod::Usage;
53 use Hash::Util qw(lock_keys);
55 our %Opt;
56 lock_keys %Opt, map { /([^=|!]+)/ } @opt;
57 GetOptions(\%Opt,
58 @opt,
59 ) or pod2usage(1);
60 if ($Opt{help}) {
61 pod2usage(0);
64 my $days_for_three = 365;
65 my @p = (
66 { k => 3, m => $days_for_three, f => 'dir' }, # expensive, runs
67 # for a (feeled)
68 # hour, consider
69 # --onlytar
70 { k => 17, m => 20 }, # as long as we have more than 17, we remove everything older 20
71 { k => 15, m => 30 },
72 { k => 13, m => 40 },
73 { k => 11, m => 50 },
74 { k => 9, m => 60 },
75 { k => 7, m => 70 },
76 { k => 5, m => 80 },
77 { k => 4, m => 90 },
78 { k => 3, m => $days_for_three, f => 'tar' },
79 { k => 2, m => 731 }, # as long as we have more than 2, we remove everything older ...
80 { k => 1, m => 1096 }, # as long as we have more than 1, we remove everything older ...
83 PARAMCOMBI: for my $p (@p) {
84 $p->{k} ||= 3;
85 $p->{m} ||= $days_for_three;
86 $p->{f} ||= "tar";
87 if ($Opt{onlytar} && $p->{f} ne 'tar') {
88 warn "Info: skipping run for $p->{f} due 'onlytar'\n";
89 next PARAMCOMBI;
91 my @system = ($^X,
92 "$FindBin::Bin/analysis-oldreports-extinction-program.pl",
93 "--yes",
94 "--untildf=48000000",
95 "--noni",
96 "--keepresults=$p->{k}",
97 "--minage=$p->{m}",
98 "--focus=$p->{f}",
100 warn "Calling @system\n";
101 0 == system @system or die "Error while running @system";
104 # Local Variables:
105 # mode: cperl
106 # cperl-indent-level: 4
107 # End: