/[webpac]/trunk/all2xml.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/all2xml.pl

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

revision 97 by dpavlin, Sun Jul 13 21:57:12 2003 UTC revision 102 by dpavlin, Mon Jul 14 10:54:34 2003 UTC
# Line 82  sub data2xml { Line 82  sub data2xml {
82    
83          # sort subrouting using order="" attribute          # sort subrouting using order="" attribute
84          sub by_order {          sub by_order {
85                  return 0 if (! $config->{indexer}->{$a}->{order});                  my $va = $config->{indexer}->{$a}->{order} ||
86                  return 0 if (! $config->{indexer}->{$b}->{order});                          $config->{indexer}->{$a};
87                    my $vb = $config->{indexer}->{$b}->{order} ||
88                            $config->{indexer}->{$b};
89    
90                  return $config->{indexer}->{$a}->{order} <=>                  return $va <=> $vb;
                         $config->{indexer}->{$b}->{order} ;  
91          }          }
92    
93          foreach my $field (sort by_order keys %{$config->{indexer}}) {          foreach my $field (sort by_order keys %{$config->{indexer}}) {
94    
95                  $field=x($field);                  $field=x($field);
   
96                  $field_usage{$field}++;                  $field_usage{$field}++;
97    
98                  my $swish_data = "";                  my $swish_data = "";
# Line 294  print STDERR "reading ./import_xml/$type Line 294  print STDERR "reading ./import_xml/$type
294          # output current progress indicator          # output current progress indicator
295          my $last_p = 0;          my $last_p = 0;
296          sub progress {          sub progress {
297                  # XXX return if ($show_progress ne "");                  return if (! $show_progress);
298                  my $current = shift;                  my $current = shift;
299                  my $total = shift || 1;                  my $total = shift || 1;
300                  my $p = int($current * 100 / $total);                  my $p = int($current * 100 / $total);
# Line 327  print STDERR "using: $type...\n"; Line 327  print STDERR "using: $type...\n";
327                  $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);
328                  my $db = OpenIsis::open( $isis_db );                  my $db = OpenIsis::open( $isis_db );
329    
330                    # OpenIsis::ERR_BADF
331                    if ($db == -4) {
332                            print STDERR "FATAL: OpenIsis can't find file $isis_db\n";
333                            next;
334                    # OpenIsis::ERR_IO
335                    } elsif ($db == -5) {
336                            print STDERR "FATAL: OpenIsis can't access file $isis_db\n";
337                            next;
338                    } elsif ($db < 0) {
339                            print STDERR "FATAL: OpenIsis unknown error $db with file $isis_db\n";
340                            next;
341                    }
342    
343                  my $max_rowid = OpenIsis::maxRowid( $db );                  my $max_rowid = OpenIsis::maxRowid( $db );
344    
345                  print STDERR "Reading database: $isis_db [$max_rowid rows]\n";                  print STDERR "Reading database: $isis_db [$max_rowid rows]\n";

Legend:
Removed from v.97  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.26