Changeset 27482

Show
Ignore:
Timestamp:
27.05.2013 12:50:19 (6 years ago)
Author:
jmt12
Message:

Replace slash replacement regexs with a call the FileUtils::sanitizePath() which does a much better job of preserving file protocols

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

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/buildcolutils.pm

    r27392 r27482  
    273273  } 
    274274  # End Mod 
    275   $self->{'archivedir'} =~ s/[\\\/]+/\//g; 
    276   $self->{'archivedir'} =~ s/\/$//; 
     275  $self->{'archivedir'} = &FileUtils::sanitizePath($self->{'archivedir'}); 
     276  #$self->{'archivedir'} =~ s/[\\\/]+/\//g; 
     277  #$self->{'archivedir'} =~ s/\/$//; 
    277278 
    278279  # - resolve (and possibly set to default) builddir 
     
    290291  } 
    291292  # - why don't we make builddir absolute similar to archivedir? 
    292   $self->{'builddir'} =~ s/[\\\/]+/\//g; 
    293   $self->{'builddir'} =~ s/\/$//; 
     293  $self->{'builddir'} = &FileUtils::sanitizePath($self->{'builddir'}); 
     294  #$self->{'builddir'} =~ s/[\\\/]+/\//g; 
     295  #$self->{'builddir'} =~ s/\/$//; 
    294296 
    295297  if (defined $collectcfg->{'cachedir'} && $self->{'cachedir'} eq "") 
  • main/trunk/greenstone2/perllib/inexport.pm

    r27394 r27482  
    274274    } 
    275275 
    276     # @todo &FileUtils::sanitizePath($archivedir) [jmt12] 
    277     $archivedir =~ s/[\\\/]+/\//g; 
    278     $archivedir =~ s/\/$//; 
     276    $archivedir = &FileUtils::sanitizePath($archivedir) 
     277    #$archivedir =~ s/[\\\/]+/\//g; 
     278    #$archivedir =~ s/\/$//; 
    279279    $self->{'archivedir'} = $archivedir; 
    280280 
     
    441441    } 
    442442 
    443     $self->{'manifest'} =~ s/[\\\/]+/\//g; 
    444     $self->{'manifest'} =~ s/\/$//; 
     443        $self->{'manifest'} = &FileUtils::sanitizePath($self->{'manifest'}); 
     444    #$self->{'manifest'} =~ s/[\\\/]+/\//g; 
     445    #$self->{'manifest'} =~ s/\/$//; 
    445446 
    446447    $manifest_lookup->parse($manifest_filename);