Subversion Repositories DevTools

Rev

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

Rev 5253 Rev 5272
Line 1158... Line 1158...
1158
    my $countRemain = ( scalar @quarantineItems );
1158
    my $countRemain = ( scalar @quarantineItems );
1159
    foreach my $entry (sort {$b->{age} <=> $a->{age} } @quarantineItems)
1159
    foreach my $entry (sort {$b->{age} <=> $a->{age} } @quarantineItems)
1160
    {
1160
    {
1161
        my $rv;
1161
        my $rv;
1162
        my $emsg = ' - with error';
1162
        my $emsg = ' - with error';
-
 
1163
        my $s3error = 0;
1163
 
1164
 
1164
        my $path = $entry->{path};
1165
        my $path = $entry->{path};
1165
        my $tpath = $path;
1166
        my $tpath = $path;
1166
           $tpath =~ s~^$config{dpkg_archive}~~;
1167
           $tpath =~ s~^$config{dpkg_archive}~~;
1167
           $tpath = $quarantineInstance.$tpath;
1168
           $tpath = $quarantineInstance.$tpath;
Line 1189... Line 1190...
1189
                $rv = system ( "$progBase/savePkgToS3.sh", "--bucket=$config{S3Bucket}" ,"--path=$path" );
1190
                $rv = system ( "$progBase/savePkgToS3.sh", "--bucket=$config{S3Bucket}" ,"--path=$path" );
1190
                if ( $rv )
1191
                if ( $rv )
1191
                {
1192
                {
1192
                    ReportError ("Move $path to S3");
1193
                    ReportError ("Move $path to S3");
1193
                    $s3msg = ' - with S3 error';
1194
                    $s3msg = ' - with S3 error';
-
 
1195
                    $s3error = 1;
-
 
1196
                    $emsg = ' - S3 Error prevented quarantine';
1194
                }
1197
                }
1195
                Log (sprintf("S3Quarantined:%s%s,%4.4s,%s%s", $testMsg, $entry->{reason}, $entry->{age}, $path, $s3msg));
1198
                Log (sprintf("S3Quarantined:%s%s,%4.4s,%s%s", $testMsg, $entry->{reason}, $entry->{age}, $path, $s3msg));
1196
            }
1199
            }
1197
 
1200
 
1198
            #
-
 
1199
            #   Transfer then delete to local directory
-
 
1200
            #
-
 
1201
            unless (-d $tdir)
1201
            unless ($s3error)
1202
            {
-
 
1203
                eval { mkpath($tdir) };
-
 
1204
                ReportError ("Did not create quarantine target: $tdir")
-
 
1205
                    unless (-d $tdir);
-
 
1206
            }
-
 
1207
 
-
 
1208
            if (-d $tdir)
-
 
1209
            {
1202
            {
-
 
1203
                #
1210
                $rv = system ('mv', '-n', $path, $tdir);
1204
                #   Transfer then delete to local directory
-
 
1205
                #
1211
                if ( $rv )
1206
                unless (-d $tdir)
1212
                {
1207
                {
1213
                    ReportError ("Move $path to $tdir");
1208
                    eval { mkpath($tdir) };
1214
                    #
-
 
1215
                    # Clean up what may have been moved
-
 
1216
                    # NOTE: deleted so that we don't loose stuff if it gets ugly
1209
                    ReportError ("Did not create quarantine target: $tdir")
1217
    #                rmtree( $tpath);
-
 
1218
    #                rmdir ($tdir);
1210
                        unless (-d $tdir);
1219
                }
1211
                }
-
 
1212
 
1220
                else
1213
                if (-d $tdir)
1221
                {
1214
                {
-
 
1215
                    $rv = system ('mv', '-n', $path, $tdir);
-
 
1216
                    if ( $rv )
-
 
1217
                    {
-
 
1218
                        ReportError ("Move $path to $tdir");
-
 
1219
                        #
-
 
1220
                        # Clean up what may have been moved
-
 
1221
                        # NOTE: deleted so that we don't loose stuff if it gets ugly
-
 
1222
        #                rmtree( $tpath);
-
 
1223
        #                rmdir ($tdir);
-
 
1224
                    }
-
 
1225
                    else
-
 
1226
                    {
1222
                    $emsg = '';
1227
                        $emsg = '';
-
 
1228
                    }
1223
                }
1229
                }
1224
            }
1230
            }
1225
        }
1231
        }
1226
        else
1232
        else
1227
        {
1233
        {