Subversion Repositories DevTools

Rev

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

Rev 6132 Rev 6241
Line 884... Line 884...
884
 
884
 
885
    #
885
    #
886
    #   Start the log file
886
    #   Start the log file
887
    Log ("TEST Mode Enabled") if $opt_test;
887
    Log ("TEST Mode Enabled") if $opt_test;
888
    Log ("QuarantinePath: $quarantineInstance");
888
    Log ("QuarantinePath: $quarantineInstance");
-
 
889
    Log ("Quarantine store Disabled") if ($config{qdirAge} <= 0);
889
    Log ("Config: $_ = $config{$_}") foreach ( sort keys %config );
890
    Log ("Config: $_ = $config{$_}") foreach ( sort keys %config );
890
    Log ("Ignore: $_") foreach ( sort keys %retainPkgs );
891
    Log ("Ignore: $_") foreach ( sort keys %retainPkgs );
891
 
892
 
892
    #
893
    #
893
    # Create a 'nice' symlink to the latest log file
894
    # Create a 'nice' symlink to the latest log file
Line 896... Line 897...
896
    symlink( $logName, $logLatest);
897
    symlink( $logName, $logLatest);
897
 
898
 
898
    #
899
    #
899
    #   Clean up old files
900
    #   Clean up old files
900
    #
901
    #
-
 
902
    if ($config{qdirAge} > 0) {
901
    opendir( Q, $config{quarantine} ) || Error ("opendir failed on: $config{quarantine}" );
903
        opendir( Q, $config{quarantine} ) || Error ("opendir failed on: $config{quarantine}" );
902
 
904
 
903
    # delete any quarantine instance older than 90 days
905
        # delete any quarantine instance older than 90 days
904
    while ( my $file = readdir( Q ) )
906
        while ( my $file = readdir( Q ) )
905
    {  
907
        {  
906
        #
908
            #
907
        #   Skip housekeeping directory entries
909
            #   Skip housekeeping directory entries
908
        #
910
            #
909
        next if ( $file eq '.' );
911
            next if ( $file eq '.' );
910
        next if ( $file eq '..' );
912
            next if ( $file eq '..' );
911
        next if ( $file eq 'lost+found' );
913
            next if ( $file eq 'lost+found' );
912
 
914
 
913
        my $path = join( '/', $config{quarantine} . "/" . $file);
915
            my $path = join( '/', $config{quarantine} . "/" . $file);
914
        my $age = checkTime( $path );
916
            my $age = checkTime( $path );
915
        if ( $age > $config{qdirAge} )
917
            if ( $age > $config{qdirAge} )
916
        {
918
            {
917
            Log ("Old Quarantine Removed: $path");
919
                Log ("Old Quarantine Removed: $path");
918
            Verbose ("Test: Delete Dir: $path") if ( $opt_test );
920
                Verbose ("Test: Delete Dir: $path") if ( $opt_test );
919
            rmtree($path, 0, 1) unless $opt_test;
921
                rmtree($path, 0, 1) unless $opt_test;
-
 
922
            }
920
        }
923
        }
-
 
924
        
-
 
925
        closedir( Q );
921
    }
926
    }
922
    
-
 
923
    closedir( Q );
-
 
924
}
927
}
925
 
928
 
926
#-------------------------------------------------------------------------------
929
#-------------------------------------------------------------------------------
927
# Function        : checkTime
930
# Function        : checkTime
928
#
931
#