/[webpac2]/trunk/lib/WebPAC/Output/Webpacus.pm
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/lib/WebPAC/Output/Webpacus.pm

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

revision 932 by dpavlin, Wed Oct 31 11:26:10 2007 UTC revision 933 by dpavlin, Wed Oct 31 11:26:12 2007 UTC
# Line 14  use Data::Dump qw/dump/; Line 14  use Data::Dump qw/dump/;
14  use WebPAC::Common qw/force_array/;  use WebPAC::Common qw/force_array/;
15  use Carp qw/confess/;  use Carp qw/confess/;
16  use Cwd;  use Cwd;
17    use File::Slurp;
18    
19  use Jifty;  use Jifty;
20    
# Line 133  sub finish { Line 134  sub finish {
134          my $count = 0;          my $count = 0;
135    
136          foreach my $field ( keys %$fields ) {          foreach my $field ( keys %$fields ) {
137                  $log->debug("adding search field: $field");                  my $items = $fields->{$field} || confess "no field?";
138                  $o->create( name => $field ); # || $log->logdie("can't add $field");                  $log->debug("adding search field: $field [$items]");
139                    $o->load_or_create(
140                            name => $field,
141                            items => $items,
142                    ); # || $log->logdie("can't add $field");
143                  $count++;                  $count++;
144          }          }
145    
146            $log->info("synced $count search fields with Webpacus");
147    
148            my $glue_path = "$path/lib/Webpacus/Webpac.pm";
149    
150            $log->info("creating clue class Webpacus::Webpac at $glue_path");
151    
152            my $glue = <<"_END_OF_GLUE_";
153    package Webpacus::Webpac;
154    
155    =head1 NAME
156    
157    Webpacus::Webpac - configuration exported from WebPAC
158    
159    =cut
160    
161    use strict;
162    use warnings;
163    
164    sub index_path { '/data/webpac2/var/kinosearch/webpacus' };
165    
166    1;
167    _END_OF_GLUE_
168    
169            $log->debug("glue source:\n$glue");
170    
171            write_file( $glue_path, $glue ) || $log->logdie("can't create $glue_path: $!");
172    
173          return $count;          return $count;
174    
175  }  }

Legend:
Removed from v.932  
changed lines
  Added in v.933

  ViewVC Help
Powered by ViewVC 1.1.26