Commit 64e8c228 authored by Dietmar Maurer's avatar Dietmar Maurer

bug fix: only send updated package list once

parent 4a17ed2b
......@@ -163,7 +163,7 @@ my $update_pve_pkgstatus = sub {
my $notify_status = {};
my $oldpkglist = &$read_cached_pkgstatus();
foreach my $pi (@$oldpkglist) {
$notify_status->{$pi->{Package}} = $pi->{Version};
$notify_status->{$pi->{Package}} = $pi->{NotifyStatus};
}
my $pkglist = [];
......@@ -349,7 +349,10 @@ __PACKAGE__->register_method({
$data .= "The following updates are available:\n\n";
my $count = 0;
foreach my $p (sort {$a->{Package} cmp $b->{Package} } @$pkglist) {
next if $p->{NotifyStatus} && $p->{NotifyStatus} eq $p->{Version};
$count++;
if ($p->{OldVersion}) {
$data .= "$p->{Package}: $p->{OldVersion} ==> $p->{Version}\n";
} else {
......@@ -357,6 +360,8 @@ __PACKAGE__->register_method({
}
}
return if !$count;
my $fh = IO::File->new("|sendmail -B 8BITMIME $mailto") ||
die "unable to open 'sendmail' - $!";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment