Skip to content

Commit

Permalink
Item13079: Bootstrap the OS and DetailedOS
Browse files Browse the repository at this point in the history
For some reason, these were not saved in the config, and were
re-discovered for every transaction.

Add them to the bootstrap, so they get set early and only once.
  • Loading branch information
gac410 committed Dec 8, 2014
1 parent 9523f57 commit 415e825
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion core/lib/Foswiki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,18 @@ $Foswiki::cfg{PermittedRedirectHostUrls} = '';
# should only need to override if there is something badly wrong with
# those calculations*
#
# If these fields are empty, Foswiki will dynamically set then for each
# transaction. Foswiki 1.2 bootstrap will set them during initial configuraiton.
#
# If you move this Foswiki install to a different system & OS, you are recommended
# to reconfigure to reapply OS dependent defaults.
#
# {OS} may be one of UNIX WINDOWS VMS DOS MACINTOSH OS2
# $Foswiki::cfg{OS} = '';

# **STRING 20 EXPERT**
# The value of Perl $OS
$Foswiki::cfg{DetailedOS} = '';
# $Foswiki::cfg{DetailedOS} = '';

# **NUMBER CHECK="min:-1" EXPERT**
# Maximum number of backup versions of LocalSite.cfg to retain when changes
Expand Down
8 changes: 6 additions & 2 deletions core/lib/Foswiki/Configure/Load.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ sub readConfig {
# Read Foswiki.spec and LocalSite.cfg
# (Suppress Foswiki.spec if already read)

_workOutOS();
# Old configs might not bootstrap the OS settings, so set if needed.
_workOutOS() unless ( $Foswiki::cfg{OS} && $Foswiki::cfg{DetailedOS} );

my @files = qw( Foswiki.spec LocalSite.cfg );
if ($noLocal) {
Expand Down Expand Up @@ -324,7 +325,7 @@ sub setBootstrap {

# Bootstrap works out the correct values of these keys
my @BOOTSTRAP =
qw( {DataDir} {DefaultUrlHost} {PubUrlPath} {ToolsDir} {WorkingDir}
qw( {DataDir} {DefaultUrlHost} {DetailedOS} {OS} {PubUrlPath} {ToolsDir} {WorkingDir}
{PubDir} {TemplateDir} {ScriptDir} {ScriptUrlPath} {ScriptUrlPaths}{view}
{ScriptSuffix} {LocalesDir} {Store}{Implementation}
{Store}{SearchAlgorithm} );
Expand Down Expand Up @@ -453,6 +454,9 @@ EPITAPH
Foswiki::Configure::Load::readConfig( 0, 0, 1, 1 );

_workOutOS();
print STDERR
"AUTOCONFIG: Detected OS $Foswiki::cfg{OS}: DetailedOS: $Foswiki::cfg{DetailedOS} \n"
if (TRAUTO);

$Foswiki::cfg{isVALID} = 1;
Foswiki::Configure::Load::setBootstrap();
Expand Down

0 comments on commit 415e825

Please sign in to comment.