diff options
author | Tim Retout <tim@retout.co.uk> | 2012-02-19 13:14:22 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-20 11:30:41 +0000 |
commit | 8b65b2a3842a90ba565285f0cb796c5d76eef4ce (patch) | |
tree | efea26805569f432738e2ae0d9f09c0334ed24ea /solenv/bin | |
parent | 621896fb558d25d3146201f3d54fca103bcf222c (diff) |
Replace installer::parameter::make_absolute_path.
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer/parameter.pm | 62 |
1 files changed, 6 insertions, 56 deletions
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index 3ea13f802591..7335c018785d 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -28,6 +28,8 @@ package installer::parameter; use Cwd; +use File::Spec::Functions qw(rel2abs); + use installer::exiter; use installer::files; use installer::globals; @@ -195,58 +197,6 @@ sub control_fundamental_parameter } } -########################################################## -# The path parameters can be relative or absolute. -# This function creates absolute paths. -########################################################## - -sub make_path_absolute -{ - my ($pathref) = @_; - - if ( $installer::globals::isunix ) - { - if (!($$pathref =~ /^\s*\//)) # this is a relative unix path - { - $$pathref = cwd() . $installer::globals::separator . $$pathref; - } - } - - if ( $installer::globals::iswin ) - { - if ( $^O =~ /cygwin/i ) - { - if ( $$pathref !~ /^\s*\// && $$pathref !~ /^\s*\w\:/ ) # not an absolute POSIX or DOS path - { - $$pathref = cwd() . $installer::globals::separator . $$pathref; - } - my $p = $$pathref; - chomp( $p ); - my $q = ''; - # Avoid the $(LANG) problem. - if ($p =~ /(\A.*)(\$\(.*\Z)/) { - $p = $1; - $q = $2; - } - $p =~ s/\\/\\\\/g; - chomp( $p = qx{cygpath -w "$p"} ); - $$pathref = $p.$q; - # Use windows paths, but with '/'s. - $$pathref =~ s/\\/\//g; - } - else - { - if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path (no dos drive) - { - $$pathref = cwd() . $installer::globals::separator . $$pathref; - - $$pathref =~ s/\//\\/g; - } - } - } - $$pathref =~ s/[\/\\]\s*$//; # removing ending slashes -} - ################################################## # Setting some global parameters # This has to be expanded with furher platforms @@ -388,7 +338,7 @@ sub setglobalvariables if (!($installer::globals::unpackpath eq "")) { - make_path_absolute(\$installer::globals::unpackpath); + $installer::globals::unpackpath = rel2abs($installer::globals::unpackpath); } $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//; @@ -478,7 +428,7 @@ sub control_required_parameter if (!($installer::globals::idttemplatepath eq "")) # idttemplatepath set, relative or absolute? { - make_path_absolute(\$installer::globals::idttemplatepath); + $installer::globals::idttemplatepath = rel2abs($installer::globals::idttemplatepath); } installer::remover::remove_ending_pathseparator(\$installer::globals::idttemplatepath); @@ -487,7 +437,7 @@ sub control_required_parameter if (!($installer::globals::idtlanguagepath eq "")) # idtlanguagepath set, relative or absolute? { - make_path_absolute(\$installer::globals::idtlanguagepath); + $installer::globals::idtlanguagepath = rel2abs($installer::globals::idtlanguagepath); } installer::remover::remove_ending_pathseparator(\$installer::globals::idtlanguagepath); @@ -527,7 +477,7 @@ sub control_required_parameter if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ) && ( $installer::globals::patchincludepath )) { - make_path_absolute(\$installer::globals::patchincludepath); + $installer::globals::patchincludepath = rel2abs($installer::globals::patchincludepath); $installer::globals::patchincludepath = installer::converter::make_path_conform($installer::globals::patchincludepath); } |