Skip to content

Commit

Permalink
Item9206: BuildContrib un-necessarily assumes unix paths as input
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@7944 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jun 28, 2010
1 parent dc962a0 commit 7ddb451
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions BuildContrib/lib/Foswiki/Contrib/Build.pm
Expand Up @@ -89,14 +89,13 @@ $ENV{'LC_ALL'} = 'C';
sub _findRelativeTo {
my ( $startdir, $name ) = @_;

my @path = split( /\/+/, $startdir );
my @path = split( /[\/\\]+/, $startdir );

while ( scalar(@path) > 0 ) {
my $found = join( '/', @path ) . '/' . $name;
return $found if -e $found;
pop(@path);
}

#try legacy TWiki Contrib
$startdir =~ s/\/Foswiki\//\/TWiki\//g;
@path = split( /\/+/, $startdir );
Expand Down Expand Up @@ -405,16 +404,19 @@ sub _loadConfig {
use vars qw($VAR1);

if ( !defined $this->{config} ) {
if ( -r "$ENV{HOME}/.buildcontrib" ) {
do "$ENV{HOME}/.buildcontrib";
#TODO: this really should be abstracted
my $configLocation = $this->{libdir}; #default to leave one in each contrib - used for windows atm
$configLocation = $ENV{HOME} if (defined($ENV{HOME}));
if ( -r "$configLocation/.buildcontrib" ) {
do "$configLocation/.buildcontrib";
$this->{config} = $VAR1;
print "Loaded config from $this->{config}->{file}\n";
}
else {
}
unless ( $this->{config} ) {
$this->{config} = {
file => "$ENV{HOME}/.buildcontrib",
file => "$configLocation/.buildcontrib",
passwords => {},
repositories => {},
};
Expand Down

0 comments on commit 7ddb451

Please sign in to comment.