From 6cfc19f7ef6bd34f017b472bb45b2cb0abb6dd2c Mon Sep 17 00:00:00 2001 From: tonnesen Date: Mon, 24 Jun 2002 16:58:52 +0000 Subject: [PATCH] mkdir now checks for existence of parent directories and creates them as well. Parent directories, if created, will have 0775 permissions, $kohadir and $opacdir will have 0770. --- installer.pl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/installer.pl b/installer.pl index 09cfd8321e..03d1bd02d7 100644 --- a/installer.pl +++ b/installer.pl @@ -368,7 +368,17 @@ CREATING REQUIRED DIRECTORIES unless ( -d $kohadir ) { print "Creating $kohadir...\n"; - mkdir ($kohadir, oct(770)); + my $result=mkdir ($kohadir, oct(770)); + if ($result==0) { + my @dirs = split(m#/#, $kohadir); + my $checkdir=''; + foreach (@dirs) { + $checkdir.="$_/"; + unless (-e "$checkdir") { + mkdir($checkdir, 0775); + } + } + } chown (oct(0), (getgrnam($httpduser))[2], "$kohadir"); chmod (oct(770), "$kohadir"); } @@ -386,7 +396,17 @@ unless ( -d "$kohadir/modules" ) { } unless ( -d $opacdir ) { print "Creating $opacdir...\n"; - mkdir ($opacdir, oct(770)); + my $result=mkdir ($opacdir, oct(770)); + if ($result==0) { + my @dirs = split(m#/#, $opacdir); + my $checkdir=''; + foreach (@dirs) { + $checkdir.="$_/"; + unless (-e "$checkdir") { + mkdir($checkdir, 0775); + } + } + } chown (oct(0), (getgrnam($httpduser))[2], "$opacdir"); chmod (oct(770), "$opacdir"); } -- 2.39.5