diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2002-08-22 12:32:30 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2002-08-22 12:32:30 +0000 |
commit | ceaf346c42479f06fd259f1cc1b09b940b56671e (patch) | |
tree | 71b070712b857aeea00e104019f9c6e50b311d45 /solenv/bin/guw.pl | |
parent | daeeb66bf023e03d3be16c18ad0597b18fa5d2b3 (diff) |
#100157# added -env switch: patch selected environment variables accessed with getenv()
Diffstat (limited to 'solenv/bin/guw.pl')
-rwxr-xr-x | solenv/bin/guw.pl | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/solenv/bin/guw.pl b/solenv/bin/guw.pl index 68c6c92cb92f..5d9d83c34703 100755 --- a/solenv/bin/guw.pl +++ b/solenv/bin/guw.pl @@ -5,9 +5,9 @@ eval 'exec perl -wS $0 ${1+"$@"}' # # $RCSfile: guw.pl,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: hjs $ $Date: 2002-07-17 15:45:02 $ +# last change: $Author: hjs $ $Date: 2002-08-22 13:32:30 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -181,13 +181,57 @@ sub replace_cyg { if ( defined $debug ) { print(STDERR "Converted line:${para}:\n" );}; } # else } # foreach loop - } +} +#---------------------------------------------------------- +# Function name: replace_cyg_env +# Description: Process selected environment variables and change +# them to Windows Format. +# Arguments: - +# Return value: - +#---------------------------------------------------------- +sub replace_cyg_env { + @affected_vars = ( + 'SOLAR_VERSION', + 'SOLARVERSION', + 'SOLARVER', + 'SRC_ROOT', + 'LOCALINI', + 'GLOBALINI', + 'SOLARENV', + 'STAR_INSTPATH', + 'STAR_SOLARPATH', + 'STAR_PACKMISC', + 'STAR_SOLARENVPATH', + 'STAR_INITROOT', + 'STAR_STANDLST' + ); + foreach my $one_var ( @affected_vars ) + { + my $this_var = $ENV{ $one_var }; + if ( defined $this_var ) + { + if ( defined $debug ) { print(STDERR "ENV $one_var before: ".$ENV{ $one_var}."\n" );}; + $ENV{ $one_var } = WinFormat( $this_var ); + if ( defined $debug ) { print(STDERR "ENV $one_var after : ".$ENV{ $one_var}."\n" );}; + } + } + +} #--------------------------------------------------------------------------- # main @params = @ARGV; $command = shift(@params); +while ( $command =~ /^-/ ) +{ + if ( $command eq "-env" ) + { + replace_cyg_env; + } + + $command = shift(@params); +} print( STDERR "Command: $command\n" ); replace_cyg(\@params); |