Changeset 11334
- Timestamp:
- 2006-03-13T13:11:54+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ISISPlug.pm
r11332 r11334 117 117 my $self = shift (@_); 118 118 my ($filename, $encoding, $language, $textref) = @_; 119 120 my ($databasename) = ($filename =~ /(.*)\.mst$/i); 119 my $outhandle = $self->{'outhandle'}; 120 121 my ($database_file_path_root) = ($filename =~ /(.*)\.mst$/i); 122 my $mst_file_path_relative = $filename; 123 $mst_file_path_relative =~ s/^.+import.(.*?)$/$1/; 121 124 122 125 # Check the associated .fdt and .xrf files exist 123 126 # These files must have a lowercase extension for the IsisGdl program to work 124 127 # Bailing out because of this is kind of crappy but it is only an issue on Unix 125 $self->{'fdt_filename'} = $databasename . ".fdt"; 126 if (!-e $self->{'fdt_filename'}) { 127 die "Error: Could not find ISIS FDT file " . $self->{'fdt_filename'} . ".\n"; 128 $self->{'fdt_file_path'} = $database_file_path_root . ".fdt"; 129 if (!-e $self->{'fdt_file_path'}) { 130 print STDERR "<ProcessingError n='$mst_file_path_relative' r='Could not find ISIS FDT file $self->{'fdt_file_path'}'>\n" if ($self->{'gli'}); 131 print $outhandle "Error: Could not find ISIS FDT file " . $self->{'fdt_file_path'} . ".\n"; 132 return; 128 133 } 129 $self->{'xrf_filename'} = $databasename . ".xrf"; 130 if (!-e $self->{'xrf_filename'}) { 131 die "Error: Could not find ISIS XRF file " . $self->{'xrf_filename'} . ".\n"; 134 $self->{'xrf_file_path'} = $database_file_path_root . ".xrf"; 135 if (!-e $self->{'xrf_file_path'}) { 136 print STDERR "<ProcessingError n='$mst_file_path_relative' r='Could not find ISIS XRF file $self->{'xrf_file_path'}'>\n" if ($self->{'gli'}); 137 print $outhandle "Error: Could not find ISIS XRF file " . $self->{'xrf_file_path'} . ".\n"; 138 return; 132 139 } 133 140 … … 143 150 144 151 # Parse the associated ISIS database Field Definition Table file (.fdt) 145 my %fdt_mapping = &parse_field_definition_table($self->{'fdt_file name'}, $encoding);152 my %fdt_mapping = &parse_field_definition_table($self->{'fdt_file_path'}, $encoding); 146 153 $self->{'fdt_mapping'} = \%fdt_mapping; 147 154 … … 346 353 347 354 # Delete the FDT and XRF files too 348 &util::rm($self->{'fdt_file name'});349 &util::rm($self->{'xrf_file name'});355 &util::rm($self->{'fdt_file_path'}); 356 &util::rm($self->{'xrf_file_path'}); 350 357 } 351 358
Note:
See TracChangeset
for help on using the changeset viewer.