Changeset 28489

Show
Ignore:
Timestamp:
17.10.2013 17:03:50 (6 years ago)
Author:
davidb
Message:

Support for Cygwin added

Location:
main/trunk/greenstone2/perllib/plugins
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm

    r27578 r28489  
    259259 
    260260    $filename_full_path = &util::upgrade_if_dos_filename($filename_full_path); 
    261 ###    print STDERR "*** DirectoryPlugin::file_is_blocked $filename_full_path\n"; 
    262  
    263     if ($ENV{'GSDLOS'} =~ m/^windows$/) { 
     261 
     262    if (($ENV{'GSDLOS'} =~ m/^windows$/) && ($^O ne "cygwin")) { 
    264263    # on windows, all block paths are lowercased. 
    265264    my $lower_filename = lc ($filename_full_path); 
     
    553552    #print STDERR "processing $raw_full_filename\n"; 
    554553    # Follow Windows shortcuts 
    555     if ($raw_subfile =~ /(?i)\.lnk$/ && $ENV{'GSDLOS'} =~ /^windows$/i) { 
     554    if ($raw_subfile =~ m/(?i)\.lnk$/ && (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin"))) { 
    556555        require Win32::Shortcut; 
    557556        my $shortcut = new Win32::Shortcut(&FileUtils::filenameConcatenate($dirname, $raw_subfile)); 
  • main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm

    r27306 r28489  
    220220    return undef unless $self->can_process_this_file($filename_full_path);     
    221221 
    222     if ($ENV{'GSDLOS'} =~ m/^windows$/) { 
    223          
    224         my $lower_drive = $filename_full_path; 
    225         $lower_drive =~ s/^([A-Z]):/\l$1:/i; 
    226          
    227         my $upper_drive = $filename_full_path; 
    228         $upper_drive =~ s/^([A-Z]):/\u$1:/i; 
    229          
    230         $block_hash->{'metadata_files'}->{$lower_drive} = 1; 
    231         $block_hash->{'metadata_files'}->{$upper_drive} = 1;         
    232     } 
    233     else { 
    234         $block_hash->{'metadata_files'}->{$filename_full_path} = 1; 
    235     } 
     222    if (($ENV{'GSDLOS'} =~ m/^windows$/) && ($^O ne "cygwin")) { 
     223     
     224    my $lower_drive = $filename_full_path; 
     225    $lower_drive =~ s/^([A-Z]):/\l$1:/i; 
     226     
     227    my $upper_drive = $filename_full_path; 
     228    $upper_drive =~ s/^([A-Z]):/\u$1:/i; 
     229     
     230    $block_hash->{'metadata_files'}->{$lower_drive} = 1; 
     231    $block_hash->{'metadata_files'}->{$upper_drive} = 1;         
     232    } 
     233    else { 
     234    $block_hash->{'metadata_files'}->{$filename_full_path} = 1; 
     235    } 
    236236 
    237237    return 1;