Subversion Repositories DevTools

Rev

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

Rev 4093 Rev 4127
Line 669... Line 669...
669
{
669
{
670
    my ($path) = @_;
670
    my ($path) = @_;
671
    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
671
    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
672
        $atime,$mtime,$ctime,$blksize,$blocks) = stat($path);
672
        $atime,$mtime,$ctime,$blksize,$blocks) = stat($path);
673
 
673
 
-
 
674
    unless(defined $mtime)
-
 
675
    {
-
 
676
        Warning("Bad stat for $path");
-
 
677
        $mtime = 0;
-
 
678
    }
-
 
679
 
674
    return int( ($now - $mtime) / (60 * 60 * 24));
680
    return int( ($now - $mtime) / (60 * 60 * 24));
675
}
681
}
676
 
682
 
677
#-------------------------------------------------------------------------------
683
#-------------------------------------------------------------------------------
678
# Function        : processDpkgArchive
684
# Function        : processDpkgArchive
Line 896... Line 902...
896
{
902
{
897
    my $testMsg = $opt_test ? 'Test,' : '';
903
    my $testMsg = $opt_test ? 'Test,' : '';
898
 
904
 
899
    # Process entries - oldest first
905
    # Process entries - oldest first
900
    #
906
    #
-
 
907
    my $countRemain = ( scalar @quarantineItems );
901
    foreach my $entry (sort {$b->{age} <=> $a->{age} } @quarantineItems)
908
    foreach my $entry (sort {$b->{age} <=> $a->{age} } @quarantineItems)
902
    {
909
    {
903
        my $rv;
910
        my $rv;
904
        my $emsg = ' - with error';
911
        my $emsg = ' - with error';
905
 
912
 
Line 944... Line 951...
944
 
951
 
945
        # Log operation with frills
952
        # Log operation with frills
946
        Log (sprintf("Quarantined:%s%s,%4.4s,%s%s", $testMsg, $entry->{reason}, $entry->{age}, $path, $emsg));
953
        Log (sprintf("Quarantined:%s%s,%4.4s,%s%s", $testMsg, $entry->{reason}, $entry->{age}, $path, $emsg));
947
 
954
 
948
        # Limit packages quarantined
955
        # Limit packages quarantined
-
 
956
        $countRemain--;
949
        if ($opt_pcount > 0)
957
        if ($opt_pcount > 0)
950
        {
958
        {
951
            $opt_pcount--;
959
            $opt_pcount--;
952
            if ($opt_pcount == 0)
960
            if ($opt_pcount == 0)
953
            {
961
            {
954
                Log ("Quarantine package count exceeded. Quarantine terminated");
962
                Log ("Quarantine package count exceeded. Quarantine terminated. $countRemain packages remaining");
955
                last;
963
                last;
956
            }
964
            }
957
        }
965
        }
958
    }
966
    }
959
}
967
}