Subversion Repositories DevTools

Rev

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

Rev 283 Rev 285
Line 361... Line 361...
361
# Function        : RelPath
361
# Function        : RelPath
362
#
362
#
363
# Description     : Return the relative path to the current working directory
363
# Description     : Return the relative path to the current working directory
364
#                   as provided in $Cwd
364
#                   as provided in $Cwd
365
#
365
#
366
# Inputs          : Base directory to convert
366
# Inputs          : $base       - Base directory to convert
-
 
367
#                   $here       - Optional current directory
-
 
368
#                                 $Cwd will be used if non provided
367
#
369
#
368
# Returns         : Relative path from the current directory to the base directory
370
# Returns         : Relative path from the current directory to the base directory
369
#
371
#
370
sub RelPath
372
sub RelPath
371
{
373
{
372
    my ($base) = @_;
374
    my ($base, $here) = @_;
-
 
375
 
-
 
376
    $here = $Cwd unless ( defined $here );
373
 
377
 
374
    my @base = split ('/', $base );
378
    my @base = split ('/', $base );
375
    my @here = split ('/', $Cwd );
379
    my @here = split ('/', $here );
376
    my $result;
380
    my $result;
377
 
381
 
378
    Debug("RelPath: Source: $base");
382
    Debug("RelPath: Source: $base");
379
 
383
 
380
    return $base unless ( $base =~ m~^/~ );
384
    return $base unless ( $base =~ m~^/~ );
Line 553... Line 557...
553
        #
557
        #
554
        $TrueComponent .= '/';
558
        $TrueComponent .= '/';
555
        unless ( $DirRead{ $TrueComponent }  )
559
        unless ( $DirRead{ $TrueComponent }  )
556
        {
560
        {
557
            Debug ("Reading: $TrueComponent");
561
            Debug ("Reading: $TrueComponent");
558
            opendir (TP, $TrueComponent ) or Error ("Cannot open $TrueComponent");
562
            opendir (my $tp, $TrueComponent ) or Error ("Cannot open $TrueComponent");
559
            my @dirlist = readdir TP;
563
            my @dirlist = readdir $tp;
560
            close TP;
564
            closedir $tp;
561
            $DirRead {$TrueComponent } = 1;
565
            $DirRead {$TrueComponent } = 1;
562
 
566
 
563
            #
567
            #
564
            #   Add cache entries for each path in the directory
568
            #   Add cache entries for each path in the directory
565
            #
569
            #