/usr/share/perl5/ClamTk/Startup.pm is in clamtk 5.20-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | # ClamTk, copyright (C) 2004-2015 Dave M
#
# This file is part of ClamTk (http://code.google.com/p/clamtk/).
#
# ClamTk is free software; you can redistribute it and/or modify it
# under the terms of either:
#
# a) the GNU General Public License as published by the Free Software
# Foundation; either version 1, or (at your option) any later version, or
#
# b) the "Artistic License".
package ClamTk::Startup;
use Glib 'FALSE';
use Time::Piece;
# use strict;
# use warnings;
$| = 1;
sub startup_check {
my ( $sigs_outdated, $gui_outdated );
# If the user wants a GUI update check on startup:
if ( ClamTk::Prefs->get_preference( 'GUICheck' ) ) {
if ( check_gui() ) {
$gui_outdated++;
}
}
# Check AV date - 4 days and sound the alarm
my $t = localtime;
my $today = $t->dmy( " " );
my $sig_date = check_sigs();
my $date_format = '%d %m %Y';
$today = Time::Piece->strptime( $today, '%d %m %Y' );
$sig_date = Time::Piece->strptime( $sig_date, '%Y %m %d' );
my $diff = $today - $sig_date;
if ( int( $diff->days ) >= 4 ) {
$sigs_outdated++;
}
if ( $sigs_outdated && $gui_outdated ) {
return 'both';
} elsif ( $sigs_outdated ) {
return 'sigs';
} elsif ( $gui_outdated ) {
return 'gui';
} else {
return 0;
}
}
sub check_sigs {
my $av_date = ClamTk::App->get_sigtool_info( 'date' );
return $av_date;
}
sub check_gui {
my $local_tk_version = ClamTk::App->get_TK_version();
my $remote_tk_version = ClamTk::Update->get_remote_TK_version();
my ( $local_chopped, $remote_chopped );
( $local_chopped = $local_tk_version ) =~ s/[^0-9]//;
( $remote_chopped = $remote_tk_version ) =~ s/[^0-9]//;
# Sanity check to ensure we received an answer
if ( $local_chopped && $remote_chopped ) {
return 1 if ( $remote_chopped > $local_chopped );
}
return 0;
}
1;
|