Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 114 lines (74 sloc) 1.924 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
#!/usr/local/bin/perl -w

=head1 NAME

mldistwatch - this is the pause indexer

=head1 SYNOPSIS

mldistwatch [OPTIONS]

=head1 OPTIONS

Usually called by cron. But occasionally called manually.

=over 8

=cut

my @opt =
map { /B<--(.+)>/ }
grep {s/^=item\s+//}
        split /\n/, <<'=cut';

=item B<--debug_mem!>

Spits out noise about used memory

=item B<--help|h>

This help

=item B<--symlinkinventory!>

If set, we recalculate all symlinks below
modules/by-{modules,category}, otherwise we only care for new
symlinks. Inefficient, expensive run: on 2013-01-26 it took 75 minutes

=item B<--skip-locking!>

skip locking (e.g. reindex if already indexed)

=item B<--logfile=s>

diag not to STDOUT but to this file

=item B<--pick=s@>

distro is a full path

=item B<--rewrite!>

do not index, only rewrite the index files

=item B<--fail-silently-on-concurrency-protection!>

When we fail because some other instance of this job is already
running, we often do not want to see an error message because we are a
cronjob. If this option is true, we exit instead.

=item B<--sleep=i>

time to sleep at the end of big loop

=item B<--testhost!>

Setting testhost prevents sending mail; automatically sets skip-locking too.

=cut

=back

=head1 DESCRIPTION

(TBD)

=cut

use strict;
use FindBin;
use lib "$FindBin::Bin/../lib";
use PAUSE::mldistwatch ();

use Getopt::Long ();
use Pod::Usage;

MAIN: {
    umask 0002;
    $|=1;

    my %Opt;
    Getopt::Long::GetOptions(
                             \%Opt,
                             @opt,
                            ) or pod2usage(1);
    if ($Opt{help}) {
        pod2usage(0);
    }
    if ($Opt{testhost}) {
        $Opt{"skip-locking"} = 1;
    }
    my $mldw = PAUSE::mldistwatch->new(\%Opt);
    if ($Opt{rewrite}) {
        $mldw->rewrite_indexes;
    } else {
        $mldw->reindex;
    }
}

exit;
#Local Variables:
#mode: cperl
#cperl-indent-level: 4
#End:
Something went wrong with that request. Please try again.