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