Changeset 39012


Ignore:
Timestamp:
2024-05-09T21:00:52+12:00 (5 weeks ago)
Author:
anupama
Message:

Committing some changes to code committed on linux after gs3 diffcol finally worked on windows that broke diffcol on windows for the Enhanced-PDF tutorial.

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

Legend:

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

    r38737 r39012  
    235235    # for portability between Greenstone installation, substitute gsdl environment variable in $command
    236236    my $gsdl3srchome = $ENV{'GSDL3SRCHOME'};
     237    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
     238        $gsdl3srchome =~ s@\\@\/@g;
     239    }
    237240    my $gsdl_substitute_command = $command;
    238241    $gsdl_substitute_command =~ s@$gsdl3srchome@\$GSDL3SRCHOME@g;
  • main/trunk/greenstone2/perllib/plugins/BaseMediaConverter.pm

    r38478 r39012  
    9898    }
    9999
     100    # If on windows: converting file path parameters/local vars into unix style slashes. (It's easier than
     101    # turning every windows backslash into double backslash for regex, which created more problems.)
     102    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
     103        $cached_dir =~ s@\\@\/@g;
     104        $base_dir =~ s@\\@\/@g;
     105        $collect_dir =~ s@\\@\/@g;
     106        $ENV{'GSDLHOME'} =~ s@\\@\/@g;
     107    }
     108
    100109    # populate hashmap with regex matcher to regex replacement search
    101110    # https://stackoverflow.com/questions/41334509/can-i-use-qq-or-q-instead-of-qw-in-the-following-perl-script
    102111    # https://perldoc.perl.org/perlop#Regexp-Quote-Like-Operators
    103     $prefixre_to_replacere_map{qr/^$base_dir(.*?)$/} = "";   
     112    $prefixre_to_replacere_map{qr/^$base_dir(.*?)$/} = "" if ($base_dir !~ m@\s*@);
    104113    $prefixre_to_replacere_map{qr/^$cached_dir(.*?)$/} = qr/[\/\\][^\/\\]+([\/\\][^\/\\]*)$/;
    105114    $prefixre_to_replacere_map{qr/^$collect_dir\/(tmp\/.*?)$/} = "";   
Note: See TracChangeset for help on using the changeset viewer.