Subversion Repositories DevTools

Rev

Rev 1540 | Rev 1544 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1540 Rev 1542
Line 4325... Line 4325...
4325
    {
4325
    {
4326
        Error("Incorrect number of params passed to rmDirectory() function.");
4326
        Error("Incorrect number of params passed to rmDirectory() function.");
4327
    }
4327
    }
4328
 
4328
 
4329
    my ($startingPoint) = @_;
4329
    my ($startingPoint) = @_;
4330
    
-
 
4331
    Verbose("Recursively removing Directory tree [$startingPoint]");
4330
    Verbose("Recursively removing Directory tree [$startingPoint]");
4332
 
4331
 
4333
    foreach my $item ( glob("$startingPoint/*"), glob("$startingPoint/.*") ) 
-
 
4334
    {
-
 
4335
        if ( $item !~ /^$startingPoint\/\.$/  && $item !~ /^$startingPoint\/\.\.$/ ) 
-
 
4336
        {
-
 
4337
            if ( -d "$item" )
-
 
4338
            {
-
 
4339
                rmDirectory("$item");
-
 
4340
            }
-
 
4341
            else
-
 
4342
            {
-
 
4343
                unlink("$item");
-
 
4344
                Debug("Removed file [$item].");
-
 
4345
            }
-
 
4346
        }
-
 
4347
    }
-
 
4348
 
-
 
4349
    # lets clean the starting point.
-
 
4350
    #
4332
    #
4351
    my($base)= File::Basename::basename($startingPoint);
4333
    #   Use the rmtree function
4352
    if ( "$base" ne "." && "$base" ne ".." )
4334
    #   It works better than glob when given a filepath with spaces
4353
    {
4335
    #
4354
        my $retVal = rmdir("$startingPoint");
4336
    rmtree($startingPoint, IsVerbose(1), 1);
4355
        if( $retVal )
-
 
4356
        {
-
 
4357
            Debug("Removed dir [$startingPoint].");
-
 
4358
        }
-
 
4359
        else
-
 
4360
        {
-
 
4361
            Error("Failed to remove dir [$startingPoint] : $!");
4337
    Error("Failed to remove dir [$startingPoint] : $!") if (-d $startingPoint);
4362
        }
-
 
4363
    }
4338
    
4364
    return 1;
4339
    return 1;
4365
}
4340
}
4366
 
4341
 
4367
#------------------------------------------------------------------------------
4342
#------------------------------------------------------------------------------
4368
sub CreateTargetDirStructure
4343
sub CreateTargetDirStructure