/[webpac2]/trunk/run.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/run.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 509 by dpavlin, Mon May 15 17:23:38 2006 UTC revision 510 by dpavlin, Mon May 15 17:38:22 2006 UTC
# Line 42  limit loading to 100 records Line 42  limit loading to 100 records
42    
43  remove database and Hyper Estraier index before indexing  remove database and Hyper Estraier index before indexing
44    
45  =item --only=database_name  =item --only=database_name/input_filter
46    
47  reindex just single database (legacy name is --one)  reindex just single database (legacy name is --one)
48    
49    C</input_filter> is optional part which can be C<name>
50    or C<type> from input
51    
52  =item --config conf/config.yml  =item --config conf/config.yml
53    
54  path to YAML configuration file  path to YAML configuration file
# Line 70  my $limit; Line 73  my $limit;
73  my $clean = 0;  my $clean = 0;
74  my $config = 'conf/config.yml';  my $config = 'conf/config.yml';
75  my $debug = 0;  my $debug = 0;
76  my $only_db_name;  my $only_filter;
77  my $force_set = 0;  my $force_set = 0;
78  my $stats = 0;  my $stats = 0;
79    
# Line 78  GetOptions( Line 81  GetOptions(
81          "limit=i" => \$limit,          "limit=i" => \$limit,
82          "offset=i" => \$offset,          "offset=i" => \$offset,
83          "clean" => \$clean,          "clean" => \$clean,
84          "one=s" => \$only_db_name,          "one=s" => \$only_filter,
85          "only=s" => \$only_db_name,          "only=s" => \$only_filter,
86          "config" => \$config,          "config" => \$config,
87          "debug" => \$debug,          "debug" => \$debug,
88          "force-set" => \$force_set,          "force-set" => \$force_set,
# Line 108  my $start_t = time(); Line 111  my $start_t = time();
111    
112  while (my ($database, $db_config) = each %{ $config->{databases} }) {  while (my ($database, $db_config) = each %{ $config->{databases} }) {
113    
114          next if ($only_db_name && $database !~ m/$only_db_name/i);          my ($only_database,$only_input) = split(m#/#, $only_filter);
115            next if ($only_database && $database !~ m/$only_database/i);
116    
117          my $indexer;          my $indexer;
118    
# Line 178  while (my ($database, $db_config) = each Line 182  while (my ($database, $db_config) = each
182    
183          foreach my $input (@inputs) {          foreach my $input (@inputs) {
184    
185                    next if ($only_input && $input->{name} =~ m#$only_input#i || $input->{type} =~ m#$only_input#i);
186    
187                  my $type = lc($input->{type});                  my $type = lc($input->{type});
188    
189                  die "I know only how to handle input types ", join(",", @supported_inputs), " not '$type'!\n" unless (grep(/$type/, @supported_inputs));                  die "I know only how to handle input types ", join(",", @supported_inputs), " not '$type'!\n" unless (grep(/$type/, @supported_inputs));

Legend:
Removed from v.509  
changed lines
  Added in v.510

  ViewVC Help
Powered by ViewVC 1.1.26