diff options
author | Tor Lillqvist <tml@novell.com> | 2011-03-31 20:12:42 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-03-31 20:14:06 +0200 |
commit | 455b1ed9154ecbcef2b0a25141b894abaaecbdca (patch) | |
tree | 40216236d81c73393b5948ba183050bfec29f736 /l10ntools/scripts | |
parent | 545bc689f80819e8ab61dc8b52ca235683cda993 (diff) |
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.
Diffstat (limited to 'l10ntools/scripts')
-rwxr-xr-x | l10ntools/scripts/localize.pl | 18 |
1 files changed, 16 insertions, 2 deletions
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; +} + |