[Libreoffice-commits] .: solenv/bin
Michael Meeks
mmeeks at kemper.freedesktop.org
Fri Jan 7 08:11:50 PST 2011
solenv/bin/modules/installer/archivefiles.pm | 33 ++++++++++++++++-----------
1 file changed, 20 insertions(+), 13 deletions(-)
New commits:
commit 92ac04eb389ca5f6854e38ee94f4078134e958f3
Author: Steve Butler <stevenb at kjross.com.au>
Date: Fri Jan 7 16:11:37 2011 +0000
accelerate make_installer by forking a lot less on windows
diff --git a/solenv/bin/modules/installer/archivefiles.pm b/solenv/bin/modules/installer/archivefiles.pm
index 351f58a..de5490e 100644
--- a/solenv/bin/modules/installer/archivefiles.pm
+++ b/solenv/bin/modules/installer/archivefiles.pm
@@ -36,6 +36,7 @@ use installer::globals;
use installer::logger;
use installer::pathanalyzer;
use installer::systemactions;
+use Cwd;
#################################################################
# Changing the name for files with flag RENAME_TO_LANGUAGE
@@ -261,10 +262,13 @@ sub resolving_archive_flag
my $counter = 0;
my $contains_dll = 0;
+ my @dllList = ();
+ my @dirs = ();
foreach my $member ( $zip->memberNames() )
{
$counter++;
- if ( $member =~ /.dll\s*$/ ) { $contains_dll = 1; }
+ if ( $member =~ /.dll\s*$/i ) { $contains_dll = 1; push(@dllList, $member); }
+ if ( $member =~ m/\/$/ ) { push(@dirs, $member); }
}
if (! ( $counter > 0 )) # the zipfile is empty
@@ -281,31 +285,34 @@ sub resolving_archive_flag
if (( $^O =~ /cygwin/i ) && ( $contains_dll ))
{
- # Make dll's executable
- $systemcall = "cd $unzipdir; find . -name \\*.dll -exec chmod 775 \{\} \\\;";
- $returnvalue = system($systemcall);
- $infoline = "Systemcall: $systemcall\n";
+ my $dir = getcwd();
+ chdir($unzipdir);
+ my $changed = chmod(0755, @dllList);
+ $infoline = "Changed mode of $changed files (of ".scalar(@dllList).")\n";
push( @installer::globals::logfileinfo, $infoline);
+ chdir($dir);
- if ($returnvalue)
+ if ($changed != scalar(@dllList))
{
- $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ $infoline = "ERROR: Could not chmod all files!\n";
push( @installer::globals::logfileinfo, $infoline);
}
}
- if ( ! $installer::globals::iswindowsbuild )
+ if ( ! $installer::globals::iswindowsbuild && scalar(@dirs) > 0 )
{
+ my $dir = getcwd();
+ chdir($unzipdir);
# Setting unix rights to "775" for all created directories inside the package
+ my $changed = chmod(0755, @dirs);
+ $infoline = "Changed mode of : $changed; should be: ".scalar(@dirs)."\n";
+ chdir($dir);
- $systemcall = "cd $unzipdir; find . -type d -exec chmod 775 \{\} \\\;";
- $returnvalue = system($systemcall);
- $infoline = "Systemcall: $systemcall\n";
push( @installer::globals::logfileinfo, $infoline);
- if ($returnvalue)
+ if ($changed != scalar(@dirs))
{
- $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ $infoline = "ERROR: Could not chmod all files!\n";
push( @installer::globals::logfileinfo, $infoline);
}
}
More information about the Libreoffice-commits
mailing list