From 455b1ed9154ecbcef2b0a25141b894abaaecbdca Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 31 Mar 2011 20:12:42 +0200 Subject: localize-pl-cygwin-paths.diff: cygwin paths handling in localize.pl Fixes localize.pl so that it doesn't pass Cygwin pathnames to the non-Cygwin programs it runs. --- l10ntools/scripts/localize.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'l10ntools/scripts') diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl index 0e36c7af3e4f..a53ca9caf5e7 100755 --- a/l10ntools/scripts/localize.pl +++ b/l10ntools/scripts/localize.pl @@ -307,8 +307,9 @@ sub merge_gsicheck{ $command .= "$ENV{SOLARVER}/$ENV{INPATH}/bin/gsicheck"; my $errfile = $sdffile.".err"; - $command .= " -k -c -wcf $tmpfile -wef $errfile -l \"\" $sdffile"; + $command .= " -k -c -wcf $tmpfile -wef ".fix_cygwin_path($errfile)." -l \"\" ".fix_cygwin_path($sdffile); #my $rc = system( $command ); + if ($bVerbose) { print STDOUT "localize.pl running $command\n"; } my $output = `$command`; my $rc = $? << 8; if ( $output ne "" ){ @@ -407,7 +408,7 @@ sub collectfiles{ # if ( -x $command ){ if( $command ){ if( !$bVerbose ){ $args .= " "; } - $args .= " -e -f $localizeSDF -l "; + $args .= " -e -f ".fix_cygwin_path($localizeSDF)." -l "; my $bFlag=""; if( $bAll ) {$args .= " en-US";} else{ @@ -1069,3 +1070,16 @@ sub usage{ print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n"; } +sub fix_cygwin_path +{ + my ( $path ) = @_; + + if ( $^O eq 'cygwin' ) + { + $path = qx{cygpath -m "$path"}; + chomp($path); + } + + return $path; +} + -- cgit