Skip to content

Commit

Permalink
Item10076: Guess the bin directory correctly
Browse files Browse the repository at this point in the history
And don't create working directory until guessed settings are saved.

git-svn-id: http://svn.foswiki.org/trunk@10061 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Nov 25, 2010
1 parent 96a87dc commit 86f0c3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/lib/Foswiki/Configure/Checker.pm
Expand Up @@ -102,9 +102,10 @@ sub guessMajorDir {
if ( !$Foswiki::cfg{$cfg} || $Foswiki::cfg{$cfg} eq 'NOT SET' ) {
require FindBin;
$FindBin::Bin =~ /^(.*)$/;
my @root = File::Spec->splitdir($1);
my $scriptDir = $1;
my @root = File::Spec->splitdir($scriptDir);
pop(@root);
$Foswiki::cfg{$cfg} = File::Spec->catfile( @root, $dir );
$Foswiki::cfg{$cfg} = ( $cfg eq 'ScriptDir') ? $scriptDir : File::Spec->catfile( @root, $dir );
$Foswiki::cfg{$cfg} =~ s|\\|/|g;
$msg = $this->guessed();
}
Expand Down
6 changes: 6 additions & 0 deletions core/lib/Foswiki/Configure/Checkers/WorkingDir.pm
Expand Up @@ -20,6 +20,12 @@ sub check {
#my $saveumask = umask();
#umask ( oct(000));

if ( $mess ) {
$mess .= $this->NOTE('This directory will be created after the guessed settings are saved') unless (-d "$Foswiki::cfg{WorkingDir}" );
return $mess; # guess will return message if a guess is made.
}


unless ( -d "$Foswiki::cfg{WorkingDir}" ) {
mkdir("$Foswiki::cfg{WorkingDir}", oct(755) )
|| return $this->ERROR(
Expand Down

0 comments on commit 86f0c3c

Please sign in to comment.