Changeset 32846
- Timestamp:
- 2019-03-04T13:44:41+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/inexport.pm
r32617 r32846 413 413 &FileUtils::sanitizePath($importdir); 414 414 } 415 415 416 if (!&FileUtils::directoryExists($importdir)) 416 417 { … … 1196 1197 1197 1198 foreach my $prev_file (keys %$prev_all_files) { 1198 1199 # arcinfo deals in real filenames ie windows short names. but the block hash stuff is all full long versions. 1200 $prev_file = &util::upgrade_if_dos_filename($prev_file); 1201 1199 1202 if (!&FileUtils::isFilenameAbsolute($prev_file)) { 1200 1203 my $full_prev_file = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},$prev_file); … … 1211 1214 # there any more => mark them for deletion 1212 1215 foreach my $curr_file (keys %{$block_hash->{'all_files'}}) { 1213 1216 1214 1217 my $full_curr_file = $curr_file; 1215 1218 … … 1226 1229 # delete it so that only files that need deleting are left 1227 1230 delete $full_prev_all_files->{$full_curr_file}; 1228 1229 1231 # had it before. is it a metadata file? 1230 1232 if ($block_hash->{'metadata_files'}->{$full_curr_file}) { 1231 1232 1233 # is it modified?? 1233 1234 if (-M $full_curr_file < $archiveinf_timestamp) { … … 1366 1367 1367 1368 if (!-e $full_curr_file) { 1369 $curr_file = &util::upgrade_if_dos_filename($curr_file); 1368 1370 $block_hash->{'deleted_files'}->{$curr_file} = 1; 1369 1371 } … … 1398 1400 # that this file is used in (note in most cases, it's just one OID) 1399 1401 1400 my $oids = $archive_info->get_reverseinfo($file); 1401 $archive_info->remove_reverseinfo($file); 1402 my $downgraded_file = &util::downgrade_if_dos_filename($file); 1403 my $oids = $archive_info->get_reverseinfo($downgraded_file); 1404 $archive_info->remove_reverseinfo($downgraded_file); 1402 1405 1403 1406 foreach my $oid (@$oids) { … … 1406 1409 # find the source doc (the primary file that becomes this oid) 1407 1410 my $doc_source_file = $doc_rec->{'src-file'}->[0]; 1408 $doc_source_file = &util::placeholders_to_abspath($doc_source_file );1411 $doc_source_file = &util::placeholders_to_abspath($doc_source_file, "long"); 1409 1412 1410 1413 if (!&FileUtils::isFilenameAbsolute($doc_source_file)) { … … 1414 1417 if ($doc_source_file ne $file) { 1415 1418 # its an associated or metadata file 1416 1417 1419 # mark source doc for reimport as one of its assoc files has changed or deleted 1420 #$doc_source_file = &util::upgrade_if_dos_filename($doc_source_file); 1418 1421 $block_hash->{'reindex_files'}->{$doc_source_file} = 1; 1419 1422 … … 1427 1430 if (!defined $archive_info->get_reverseinfo($assocfile)) { 1428 1431 # nothing refers to it anymore, mark for reindex. 1432 # block hash needs full filenames 1433 $assocfile = &util::upgrade_if_dos_filename($assocfile); 1429 1434 $block_hash->{'reindex_files'}->{$assocfile} = 1; 1430 1435 }
Note:
See TracChangeset
for help on using the changeset viewer.