293 |
|
|
294 |
# output current progress indicator |
# output current progress indicator |
295 |
my $last_p = 0; |
my $last_p = 0; |
296 |
|
print STDERR "## show_progress: $show_progress ##\n"; # XXX |
297 |
sub progress { |
sub progress { |
298 |
# XXX return if ($show_progress ne ""); |
return if (! $show_progress); |
299 |
my $current = shift; |
my $current = shift; |
300 |
my $total = shift || 1; |
my $total = shift || 1; |
301 |
my $p = int($current * 100 / $total); |
my $p = int($current * 100 / $total); |
328 |
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); |
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); |
329 |
my $db = OpenIsis::open( $isis_db ); |
my $db = OpenIsis::open( $isis_db ); |
330 |
|
|
331 |
|
# OpenIsis::ERR_BADF |
332 |
|
if ($db == -4) { |
333 |
|
print STDERR "FATAL: OpenIsis can't find file $isis_db\n"; |
334 |
|
next; |
335 |
|
# OpenIsis::ERR_IO |
336 |
|
} elsif ($db == -5) { |
337 |
|
print STDERR "FATAL: OpenIsis can't access file $isis_db\n"; |
338 |
|
next; |
339 |
|
} elsif ($db < 0) { |
340 |
|
print STDERR "FATAL: OpenIsis unknown error $db with file $isis_db\n"; |
341 |
|
next; |
342 |
|
} |
343 |
|
|
344 |
my $max_rowid = OpenIsis::maxRowid( $db ); |
my $max_rowid = OpenIsis::maxRowid( $db ); |
345 |
|
|
346 |
print STDERR "Reading database: $isis_db [$max_rowid rows]\n"; |
print STDERR "Reading database: $isis_db [$max_rowid rows]\n"; |