Kaydet (Commit) 079c782f authored tarafından Steve Butler's avatar Steve Butler Kaydeden (comit) Michael Meeks

accelerate make_installer by forking a lot less on windows

üst 3505b428
...@@ -36,6 +36,7 @@ use installer::globals; ...@@ -36,6 +36,7 @@ use installer::globals;
use installer::logger; use installer::logger;
use installer::pathanalyzer; use installer::pathanalyzer;
use installer::systemactions; use installer::systemactions;
use Cwd;
################################################################# #################################################################
# Changing the name for files with flag RENAME_TO_LANGUAGE # Changing the name for files with flag RENAME_TO_LANGUAGE
...@@ -261,10 +262,13 @@ sub resolving_archive_flag ...@@ -261,10 +262,13 @@ sub resolving_archive_flag
my $counter = 0; my $counter = 0;
my $contains_dll = 0; my $contains_dll = 0;
my @dllList = ();
my @dirs = ();
foreach my $member ( $zip->memberNames() ) foreach my $member ( $zip->memberNames() )
{ {
$counter++; $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 if (! ( $counter > 0 )) # the zipfile is empty
...@@ -281,31 +285,34 @@ sub resolving_archive_flag ...@@ -281,31 +285,34 @@ sub resolving_archive_flag
if (( $^O =~ /cygwin/i ) && ( $contains_dll )) if (( $^O =~ /cygwin/i ) && ( $contains_dll ))
{ {
# Make dll's executable my $dir = getcwd();
$systemcall = "cd $unzipdir; find . -name \\*.dll -exec chmod 775 \{\} \\\;"; chdir($unzipdir);
$returnvalue = system($systemcall); my $changed = chmod(0755, @dllList);
$infoline = "Systemcall: $systemcall\n"; $infoline = "Changed mode of $changed files (of ".scalar(@dllList).")\n";
push( @installer::globals::logfileinfo, $infoline); 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); 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 # 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); 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); push( @installer::globals::logfileinfo, $infoline);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment