Exclude packages already being updated from lists of updates

This commit is contained in:
Jamie Cameron
2018-03-26 17:18:49 -07:00
parent 9429f00554
commit ab6e4472fb
4 changed files with 13 additions and 6 deletions

View File

@ -706,9 +706,10 @@ sub get_update_progress
my @rv;
foreach my $f (glob("$update_progress_dir/*")) {
my %u;
&read_file($f, $u) || next;
kill(0, $u->{'pid'}) || next;
push(@rv, $u);
&read_file($f, \%u) || next;
$u{'pid'} || next;
kill(0, $u{'pid'}) || next;
push(@rv, \%u);
}
return @rv;
}

View File

@ -100,7 +100,7 @@ else {
# Do it
$msg = $in{'mode'} eq 'new' ? 'update_pkg2' : 'update_pkg';
&start_update_progress(\@pkgs);
&start_update_progress([ map { (split(/\//, $_))[0] } @pkgs ]);
if ($config{'update_multiple'} && @pkgs > 1) {
# Update all packages at once
@pkgnames = ( );

View File

@ -17,7 +17,7 @@ foreach $a (@todo) {
# Install packages that are needed
$tellcount = 0;
%already = ( );
&start_update_progress(\@todo);
&start_update_progress([ map { $_->{'name'} } @todo ]);
foreach $t (@todo) {
next if ($already{$t->{'update'}});
if ($t->{'level'} <= $config{'sched_action'}) {
@ -41,7 +41,7 @@ foreach $t (@todo) {
$tellcount++;
}
}
&end_update_progress(\@todo);
&end_update_progress();
if ($tellcount) {
# Add link to Webmin

View File

@ -247,6 +247,12 @@ if ($info->{'disk_fs'} && &show_section('disk')) {
# Package updates
if ($info->{'poss'} && &show_section('poss')) {
my @poss = @{$info->{'poss'}};
&foreign_require("package-updates");
my %prog;
foreach my $p (&package_updates::get_update_progress()) {
%prog = (%prog, (map { $_, 1 } split(/\s+/, $p->{'pkgs'})));
}
@poss = grep { !$prog{$_->{'name'}} } @poss;
my @secs = grep { $_->{'security'} } @poss;
my $msg;
if (@poss && @secs) {