Changeset 28375
- Timestamp:
- 2013-10-10T13:57:59+13:00 (11 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/mgbuilder.pm
r28215 r28375 139 139 140 140 my $osextra = ""; 141 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {141 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 142 142 $fulltextprefix =~ s@/@\\@g; 143 143 } else { … … 354 354 355 355 my $osextra = ""; 356 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {356 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 357 357 $fullindexprefix =~ s@/@\\@g; 358 358 } else { -
main/trunk/greenstone2/perllib/mgppbuilder.pm
r28215 r28375 180 180 181 181 my $osextra = ""; 182 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {182 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 183 183 $fulltextprefix =~ s@/@\\@g; 184 184 } … … 419 419 420 420 my $osextra = ""; 421 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {421 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 422 422 $fullindexprefix =~ s@/@\\@g; 423 423 } else { -
main/trunk/greenstone2/perllib/plugins/BasePlugin.pm
r27973 r28375 671 671 print $outhandle "Calling method: $cfilename:$cline $cpackage->$csubr\n"; 672 672 673 674 673 my ($filemeta) = $file =~ /([^\\\/]+)$/; # getting the tail of the filepath (skips all string parts containing slashes upto the end) 675 674 $filemeta = $self->filepath_to_utf8($filemeta, $file_encoding); … … 891 890 # Win32::GetLongFilePath() -- then the underlying file system is UTF16 892 891 893 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {892 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 894 893 # Can do better than working with the DOS character encoding returned by locale 895 894 $deduced_filename_encoding = "unicode"; … … 963 962 # abbreviated DOS form 964 963 965 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {964 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 966 965 if ((defined $filename_encoding) && ($filename_encoding eq "unicode")) { 967 966 if (-e $raw_filename) { -
main/trunk/greenstone2/perllib/util.pm
r28236 r28375 149 149 my $real_filename; 150 150 151 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {151 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 152 152 require Win32; 153 153 … … 368 368 369 369 my $join_char; 370 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {370 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 371 371 $join_char = ";"; 372 372 } else { … … 377 377 378 378 # remove duplicate slashes 379 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {379 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 380 380 $pathname =~ s/[\\\/]+/\\/g; 381 381 } else { … … 412 412 413 413 # 64 bit linux can't handle ";" as path separator, so make sure to set this to the right one for the OS 414 my $pathsep = (defined $ENV{'GSDLOS'} && $ENV{'GSDLOS'} !~ m/windows/) ? ":" : ";"; 414 ## my $pathsep = (defined $ENV{'GSDLOS'} && $ENV{'GSDLOS'} !~ m/windows/) ? ":" : ";"; 415 416 # Rewritten above to make ":" the default (Windows is the special 417 # case, anything else 'unusual' such as Solaris etc is Unix) 418 my $pathsep = (defined $ENV{'GSDLOS'} && (($ENV{'GSDLOS'} =~ m/windows/) && ($^O ne "cygwin"))) ? ";" : ":"; 415 419 416 420 # do not prepend any value/path that's already in the environment variable … … 462 466 my ($base_dir, $file) = @_; 463 467 468 # my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(0); 469 # my ($lcfilename) = ($cfilename =~ m/([^\\\/]*)$/); 470 # print STDERR "** Calling method: $lcfilename:$cline $cpackage->$csubr\n"; 471 472 464 473 my $filename_full_path = $file; 465 474 # add on directory if present … … 477 486 my $filename = shift(@_); 478 487 479 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {488 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 480 489 $filename =~ s/[^\\\\]*$//; 481 490 } … … 561 570 { 562 571 my ($filepath) = @_; 563 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {572 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 564 573 # Only need to worry about Windows, as Unix style directories already in url-format 565 574 # Convert Windows style \ => / … … 573 582 { 574 583 my ($filepath) = @_; 575 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {584 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 576 585 # Only need to worry about Windows, as Unix style directories already in url-format 577 586 # Convert Windows style \\ => / … … 629 638 my $filename_full_path = &FileUtils::filenameConcatenate($base_dir,$file); 630 639 631 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {640 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 632 641 require Win32; 633 642 … … 651 660 my ($filename_full_path,$and_encode) = @_; 652 661 653 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {662 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 654 663 # Ensure any DOS-like filename, such as test~1.txt, has been upgraded 655 664 # to its long (Windows) version … … 673 682 my ($filename_full_path) = @_; 674 683 675 if ( $ENV{'GSDLOS'} =~ m/^windows$/i) {684 if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) { 676 685 require Win32; 677 686 … … 695 704 my ($block_hash,$filename) = @_; 696 705 697 if ( $ENV{'GSDLOS'} =~ m/^windows$/) {706 if (($ENV{'GSDLOS'} =~ m/^windows$/) && ($^O ne "cygwin")) { 698 707 699 708 # lower case the entire thing, eg for cover.jpg when its actually cover.JPG … … 755 764 sub get_dirsep { 756 765 757 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {766 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 758 767 return "\\"; 759 768 } else { … … 764 773 sub get_os_dirsep { 765 774 766 if ( $ENV{'GSDLOS'} =~ /^windows$/i) {775 if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) { 767 776 return "\\\\"; 768 777 } else { … … 798 807 # .exe, otherwise they don't have to end in any extension 799 808 sub get_os_exe { 800 return ".exe" if $ENV{'GSDLOS'} =~ /^windows$/i;809 return ".exe" if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")); 801 810 return ""; 802 811 } … … 1138 1147 #my $perl_command = "(cd $GSDLHOME; export GSDLHOME=; . ./setup.bash > /dev/null; env)"; 1139 1148 my $perl_command = "(cd $GSDLHOME; /bin/bash -c \"export GSDLHOME=; source setup.bash > /dev/null; env\")"; 1140 if ($GSDLOS =~ m/windows/i){1149 if (($GSDLOS =~ m/windows/i) && ($^O ne "cygwin")) { 1141 1150 #$perl_command = "cmd /C \"cd $GSDLHOME&& set GSDLHOME=&& setup.bat > nul&& set\""; 1142 1151 $perl_command = "(cd $GSDLHOME&& set GSDLHOME=&& setup.bat > nul&& set)"; … … 1169 1178 if($ENV{'PERLPATH'}) { 1170 1179 # OR: # $perl_exec = &FileUtils::filenameConcatenate($ENV{'PERLPATH'},"perl"); 1171 if ($ENV{'GSDLOS'} =~ m/windows/) {1180 if (($ENV{'GSDLOS'} =~ m/windows/) && ($^O ne "cygwin")) { 1172 1181 $perl_exec = "$ENV{'PERLPATH'}\\Perl.exe"; 1173 1182 } else {
Note:
See TracChangeset
for help on using the changeset viewer.