Skip to content

Commit

Permalink
Item13457: More reliable location of "root directory"
Browse files Browse the repository at this point in the history
Code was using the "lib" directory as the installation root  It doesn't
really matter because all files are mapped using the $Foswiki::cfg
*Dir locations.  But configure was unable to find locally downloaded
packages.
  • Loading branch information
gac410 committed Jun 12, 2015
1 parent a49faa0 commit 3b972ed
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/lib/Foswiki/Configure/Wizards/InstallExtensions.pm
Expand Up @@ -43,11 +43,14 @@ our $installRoot;
sub _getPackage {
my ( $this, $reporter, $module, $repo, $seen ) = @_;

my ( $fwi, $ver, $fwp ) =
Foswiki::Configure::Dependency::extractModuleVersion( 'Foswiki', 1 );
ASSERT( $fwi, "No Foswiki.pm" ) if DEBUG;

my @instRoot = File::Spec->splitdir($fwp);
# Attempt to locate an "installation root". This is a bit tricky because of
# varied installations. bin and lib might be relocated to outside of the installation
# directory. pub, data, working and templates are jiggered with by VirtualHostingContrib
# LocalesDir seems to be about the safest option.
#
# SMELL: We really ought to let the package installer run without the concept of
# a root directory.
my @instRoot = File::Spec->splitdir( $Foswiki::cfg{LocalesDir} );
pop(@instRoot);

# SMELL: Force a trailing separator - Linux and Windows are inconsistent
Expand Down

0 comments on commit 3b972ed

Please sign in to comment.