version 1.8, 2017/06/30 14:53:39
|
version 1.10, 2023/05/15 02:31:01
|
Line 49 sub get_checksums {
|
Line 49 sub get_checksums {
|
} |
} |
if ($lonlib) { |
if ($lonlib) { |
push(@paths,($lonlib.'/perl/Apache/*.pm', |
push(@paths,($lonlib.'/perl/Apache/*.pm', |
|
$lonlib.'/perl/Apache/math_parser/*.pm, |
$lonlib.'/perl/Apache/localize/*.pm', |
$lonlib.'/perl/Apache/localize/*.pm', |
$lonlib.'/perl/LONCAPA/*.pm', |
$lonlib.'/perl/LONCAPA/*.pm', |
$lonlib.'/perl/AlgParser.pm', |
$lonlib.'/perl/AlgParser.pm', |
Line 88 sub get_checksums {
|
Line 89 sub get_checksums {
|
} |
} |
close($dirh); |
close($dirh); |
} |
} |
|
if ($londaemons) { |
|
my @binaries = qw (apachereload lchttpdlogs lcinstallfile lciptables lcnfsoff lcnfson lcpasswd lcuserdel pwchange); |
|
foreach my $file (@binaries) { |
|
next if ($versions{"$londaemons/$file"}); |
|
if (-B "$londaemons/$file") { |
|
if (-T $londaemons.'/.'.$file) { |
|
if (open(my $fh,'<',$londaemons.'/.'.$file)) { |
|
while (my $line=<$fh>) { |
|
if ($line =~ m{^#\s\\s[\w.]+,v\s([\d.]+)\s}) { |
|
$versions{"$londaemons/$file"} = $1; |
|
last; |
|
} |
|
} |
|
close($fh); |
|
} |
|
if ($versions{"$londaemons/$file"}) { |
|
if (open(my $fh,'<',$londaemons.'/.'.$file)) { |
|
binmode $fh; |
|
my $sha_obj = Digest::SHA->new(); |
|
$sha_obj->addfile($fh); |
|
$chksums{"$londaemons/$file"} = $sha_obj->hexdigest; |
|
close($fh); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
foreach my $key (sort(keys(%versions))) { |
foreach my $key (sort(keys(%versions))) { |
next if ($key =~ /\.lpmlsave$/); |
next if ($key =~ /\.lpmlsave$/); |
my $sum; |
unless (exists($chksums{$key})) { |
if (open(my $fh,"<$key")) { |
if (open(my $fh,"<$key")) { |
binmode $fh; |
binmode $fh; |
my $sha_obj = Digest::SHA->new(); |
my $sha_obj = Digest::SHA->new(); |
$sha_obj->addfile($fh); |
$sha_obj->addfile($fh); |
$sum = $sha_obj->hexdigest; |
$chksums{$key} = $sha_obj->hexdigest; |
close($fh); |
close($fh); |
$chksums{$key} = $sum; |
} |
} |
} |
$output .= "$key,$versions{$key},$sum\n"; |
$output .= "$key,$versions{$key},$chksums{$key}\n"; |
} |
} |
} |
} |
if ($lontabdir ne '') { |
if ($lontabdir ne '') { |
Line 141 sub compare_checksums {
|
Line 170 sub compare_checksums {
|
$numchg ++; |
$numchg ++; |
} |
} |
} else { |
} else { |
unless ((-e $key) && (-B $key)) { |
$missing{$key} = 1; |
$missing{$key} = 1; |
$numchg ++; |
$numchg ++; |
|
} |
|
} |
} |
} |
} |
foreach my $key (keys(%{$serversums})) { |
foreach my $key (keys(%{$serversums})) { |