Changeset 23418

Show
Ignore:
Timestamp:
08.12.2010 13:47:34 (8 years ago)
Author:
davidb
Message:

A few further additions to help windows keep track of c\... and C:\... filenames

Location:
main/trunk/greenstone2/perllib
Files:
3 modified

Legend:

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

    r23387 r23418  
    10271027 
    10281028    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file); 
    1029  
     1029     
    10301030    # create a new document 
    10311031    my $doc_obj = new doc ($filename_full_path, "indexed_doc", $self->{'file_rename_method'}); 
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r23415 r23418  
    285285    } 
    286286 
    287     $url_original_filename = &util::upgrade_if_dos_filename($url_original_filename); 
     287    # $url_original_filename = &util::upgrade_if_dos_filename($url_original_filename); 
     288     
     289     
    288290    $block_hash->{'file_blocks'}->{$url_original_filename} = 1; 
     291    if ($ENV{'GSDLOS'} =~ m/^windows$/) { 
     292         
     293        my $lower_drive = $url_original_filename; 
     294        $lower_drive =~ s/^([A-Z]):/\l$1:/i; 
     295        my $upper_drive = $url_original_filename; 
     296         
     297        $upper_drive =~ s/^([A-Z]):/\u$1:/i; 
     298 
     299##      print STDERR "**** HTML plugin, blocking: \"$lower_drive\"\n"; 
     300##      print STDERR "**** HTML plugin, blocking: \"$upper_drive\"\n"; 
     301         
     302        $block_hash->{'file_blocks'}->{$lower_drive} = 1; 
     303        $block_hash->{'file_blocks'}->{$upper_drive} = 1;        
     304    } 
     305    else { 
     306##      print STDERR "**** HTML plugin, blocking: $url_original_filename\n"; 
     307        $block_hash->{'file_blocks'}->{$url_original_filename} = 1; 
     308    } 
     309         
    289310    } 
    290311} 
  • main/trunk/greenstone2/perllib/util.pm

    r23416 r23418  
    11061106    } 
    11071107    # Make sure initial drive letter is lower-case (to fit in with rest of Greenstone) 
    1108     $filename_full_path =~ s/^(.)/\l$1/; 
     1108    $filename_full_path =~ s/^(.):/\l$1:/; 
    11091109    if ((defined $and_encode) && ($and_encode)) { 
    11101110        $filename_full_path = encode("utf8",$filename_full_path); 
     
    11321132    # Make sure initial drive letter is lower-case (to fit in 
    11331133    # with rest of Greenstone) 
    1134     $filename_full_path =~ s/^(.)/\l$1/; 
     1134    $filename_full_path =~ s/^(.):/\l$1:/; 
    11351135    } 
    11361136