#
# Sophos Anti Virus
#

if ($sophos) {
    do_log(2,"Using $sophos");
    $ENV{SAV_IDE} = $sophos_ide_path if ($sophos_ide_path);
    chop($output = `$sophos -nb -f -all -rec -ss -sc -archive $TEMPDIR/parts`);
    $errval = retcode($?);
    $scanner_errors &= $errval;
    do_log(2,$output);
    if ($errval) {
	if ($errval == 3) {
	    my $loutput = $output;
	    $loutput =~ s/Virus fragment/Virus/g;
	    @virusname = ($loutput =~ /Virus (.+) found/g);
	    do_virus();
	} else {
	    do_log(0,"Virus scanner failure: $sophos (error code: $errval)");
	}
    }
}
