]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/extras/import/generate-srfsh-indexer.pl
LP1054322 - libparent-perl not needed for Ubuntu Precise
[working/Evergreen.git] / Open-ILS / src / extras / import / generate-srfsh-indexer.pl
1 #!/usr/bin/perl -w
2 use strict;
3 use Getopt::Long;
4
5 die "Obsolete ... records are ingested by stored procs within the db\n";
6
7 my ($start, $stop, $count, $group, $out, $method) = (1,1,1,50,'dynamic-reindex-script.sfsh', 'open-ils.ingest.full.biblio.record_list');
8 GetOptions (    "start=i" => \$start,
9                 "end=i"   => \$stop,
10                 "groupsize=i"   => \$group,
11                 "count=i"   => \$count,
12                 "output=s"   => \$out,
13                 "method=s" => \$method,
14 );
15
16 $stop = $start + $count unless ($stop);
17
18 open SFSH, ">$out" or die("Can't open $out!  $!");
19
20 my @list;
21 for my $i ( $start .. $stop ) {
22         if ( $i % $group ) {
23                 push @list, $i;
24                 next;
25         }
26         push @list, $i;
27         print SFSH "request open-ils.ingest $method [".join(',', @list)."]\n" if (@list);
28         @list = ();
29 }
30 print SFSH "request open-ils.ingest $method [".join(',', @list)."]\n" if (@list);