summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-07-12 10:16:33 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-07-12 10:16:33 +0000
commite00d487f3a7dbc66bedf9e97a7c8577a89ecbbde (patch)
tree25605e3e9e53ff5a308264b66588133f083978b3 /solenv
parent2d2806ae423dc79aac271e68fd2605f86385efb9 (diff)
INTEGRATION: CWS native97 (1.31.86); FILE MERGED
2007/07/06 14:05:47 is 1.31.86.1: #148088# return value of new msitran.exe
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/systemactions.pm61
1 files changed, 59 insertions, 2 deletions
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index 1d66cccf8f4e..ef4a3358784e 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -4,9 +4,9 @@
#
# $RCSfile: systemactions.pm,v $
#
-# $Revision: 1.31 $
+# $Revision: 1.32 $
#
-# last change: $Author: kz $ $Date: 2007-05-10 13:56:46 $
+# last change: $Author: ihi $ $Date: 2007-07-12 11:16:33 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
@@ -94,6 +94,63 @@ sub create_directory
}
######################################################
+# Creating a new direcotory with defined privileges
+######################################################
+
+sub create_directory_with_privileges
+{
+ my ($directory, $privileges) = @_;
+
+ my $returnvalue = 1;
+ my $infoline = "";
+
+ if (!(-d $directory))
+ {
+ my $localprivileges = "0" . $privileges;
+ $returnvalue = mkdir($directory, $localprivileges);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nCreated directory: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ($installer::globals::isunix)
+ {
+ my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+ else
+ {
+ # New solution in parallel packing: It is possible, that the directory now exists, although it
+ # was not created in this process. There is only an important error, if the directory does not
+ # exist now.
+
+ if (!(-d $directory))
+ {
+ installer::exiter::exit_program("ERROR: Could not create directory: $directory", "create_directory");
+ }
+ else
+ {
+ $infoline = "\nAnother process created this directory in exactly this moment :-) : $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAlready existing directory, did not create: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ($installer::globals::isunix)
+ {
+ my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+}
+
+######################################################
# Removing a new direcotory
######################################################