[Libreoffice-commits] .: 3 commits - solenv/bin
Michael Meeks
michael at kemper.freedesktop.org
Mon Feb 20 03:31:46 PST 2012
solenv/bin/modules/installer/parameter.pm | 62 ++----------------------------
solenv/bin/modules/installer/ziplist.pm | 9 ++--
solenv/bin/modules/pre2par/parameter.pm | 29 --------------
3 files changed, 11 insertions(+), 89 deletions(-)
New commits:
commit 8b65b2a3842a90ba565285f0cb796c5d76eef4ce
Author: Tim Retout <tim at retout.co.uk>
Date: Sun Feb 19 13:14:22 2012 +0000
Replace installer::parameter::make_absolute_path.
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
index 3ea13f8..7335c01 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);
}
commit 621896fb558d25d3146201f3d54fca103bcf222c
Author: Tim Retout <tim at retout.co.uk>
Date: Sun Feb 19 14:04:09 2012 +0000
Avoid using installer::parameter in installer::ziplist
diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm
index 5ee0bb6..6435445 100644
--- a/solenv/bin/modules/installer/ziplist.pm
+++ b/solenv/bin/modules/installer/ziplist.pm
@@ -27,10 +27,11 @@
package installer::ziplist;
+use File::Spec::Functions qw(rel2abs);
+
use installer::exiter;
use installer::globals;
use installer::logger;
-use installer::parameter;
use installer::remover;
use installer::systemactions;
@@ -702,10 +703,10 @@ sub resolve_relative_pathes
{
my ( $patharrayref ) = @_;
- for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ for my $path ( @{$patharrayref} )
{
- installer::parameter::make_path_absolute(\${$patharrayref}[$i]);
- simplify_path(\${$patharrayref}[$i]);
+ $path = rel2abs($path);
+ simplify_path(\$path);
}
}
commit f0be445556c547952bafe4ac42fd14a59c09d430
Author: Tim Retout <tim at retout.co.uk>
Date: Sun Feb 19 12:45:56 2012 +0000
Remove unused pre2par::parameter::make_path_absolute
diff --git a/solenv/bin/modules/pre2par/parameter.pm b/solenv/bin/modules/pre2par/parameter.pm
index a39dbd0..efda79d 100644
--- a/solenv/bin/modules/pre2par/parameter.pm
+++ b/solenv/bin/modules/pre2par/parameter.pm
@@ -130,35 +130,6 @@ sub control_parameter
pre2par::files::check_file($pre2par::globals::prefilename);
}
-##########################################################
-# The path parameters can be relative or absolute.
-# This function creates absolute paths.
-##########################################################
-
-sub make_path_absolute
-{
- my ($pathref) = @_;
-
- if ( $pre2par::globals::isunix )
- {
- if (!($$pathref =~ /^\s*\//)) # this is a relative unix path
- {
- $$pathref = cwd() . $pre2par::globals::separator . $$pathref;
- }
- }
-
- if ( $pre2par::globals::iswin )
- {
- if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path
- {
- $$pathref = cwd() . $pre2par::globals::separator . $$pathref;
- $$pathref =~ s/\//\\/g;
- }
- }
-
- $$pathref =~ s/\Q$pre2par::globals::separator\E\s*$//; # removing ending slashes
-}
-
#####################################
# Writing parameter to shell
#####################################
More information about the Libreoffice-commits
mailing list