Skip to content

Commit

Permalink
Item13220: Eliminate FindBin call in SCRIPTHASH
Browse files Browse the repository at this point in the history
The hash does not need to be populated during bootstrap, and the code
falls apart under fcgi.

Also eliminate some more noise when configure run as -noprompt
  • Loading branch information
gac410 committed Mar 4, 2015
1 parent a4d007b commit 608a517
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions core/lib/Foswiki/Configure/Pluggables/SCRIPTHASH.pm
Expand Up @@ -13,7 +13,6 @@ use strict;
use warnings;

use File::Spec ();
use FindBin ();

use Assert;
use Foswiki::Configure::LoadSpec ();
Expand All @@ -22,17 +21,10 @@ sub construct {
my ( $settings, $file, $line ) = @_;

my $bindir = $Foswiki::cfg{ScriptDir};
unless ($bindir) {
$bindir = $FindBin::Bin;
unless ( -e "$bindir/setlib.cfg" ) {
$bindir =
Foswiki::Configure::FileUtil::findFileOnPath('../bin/setlib.cfg');
$bindir =~ s{/setlib.cfg$}{} if $bindir;
}
}
unless ($bindir) {
die "Unable to locate scripts directory";
}

# Early in bootstrap if no script directory available.
# Skip populating the SCRIPTHASH
return unless ($bindir);

my $dh;
unless ( opendir( $dh, $bindir ) ) {
Expand Down
2 changes: 1 addition & 1 deletion core/tools/configure
Expand Up @@ -258,7 +258,7 @@ unless ( $Foswiki::cfg{isVALID} ) {
# here should also be in the BOOTSTRAP array. And anything guessed in Load::bootstrapConfig
# should probably be verified here unless very certain that we guess corrrectly.

unless ( $params->{expert} ) {
unless ( $params->{expert} || $params->{noprompt} ) {

# Ask for missing parameters that cannot bootstrap in CLI
print "** Enter values for critical configuration items.\n";
Expand Down

0 comments on commit 608a517

Please sign in to comment.