Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 114 lines (74 sloc) 1.921 kB
#!/usr/local/bin/perl
=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:
Jump to Line
Something went wrong with that request. Please try again.