mirror of
https://github.com/webmin/webmin.git
synced 2026-06-19 19:00:22 +01:00
Update multiple packages at the same time https://github.com/webmin/webmin/issues/286
This commit is contained in:
@@ -2,3 +2,5 @@
|
||||
First version of this module.
|
||||
---- Changes since 1.500 ----
|
||||
Debian backport versions are no longer falsely suggested for upgrading, if the apt-show-versions command is installed.
|
||||
---- Changes since 1.790 ----
|
||||
When updating multiple packages, they are done in a single YUM or APT operation if possible.
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
cache_time=6
|
||||
update_multiple=1
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
cache_time=Hours to cache updated and available packages for,3,Don't cache
|
||||
update_multiple=Update multiple packages,1,1-All at once,0-One by one
|
||||
|
||||
@@ -85,18 +85,36 @@ else {
|
||||
|
||||
# Do it
|
||||
$msg = $in{'mode'} eq 'new' ? 'update_pkg2' : 'update_pkg';
|
||||
foreach my $ps (@pkgs) {
|
||||
($p, $s) = split(/\//, $ps);
|
||||
next if ($donedep{$p});
|
||||
print &text($msg, "<tt>$p</tt>"),"<br>\n";
|
||||
print "<ul>\n";
|
||||
@pgot = &package_install($p, $s);
|
||||
foreach $g (@pgot) {
|
||||
$donedep{$g}++;
|
||||
if ($config{'update_multiple'}) {
|
||||
# Update all packages at once
|
||||
@pkgnames = ( );
|
||||
foreach my $ps (@pkgs) {
|
||||
($p, $s) = split(/\//, $ps);
|
||||
push(@pkgnames, $p);
|
||||
$pkgsystem ||= $s;
|
||||
}
|
||||
push(@got, @pgot);
|
||||
print &text($msg, "<tt>".join(" ", @pkgnames)."</tt>"),
|
||||
"<br>\n";
|
||||
print "<ul>\n";
|
||||
@got = &package_install_multiple(\@pkgnames,
|
||||
$pkgsystem);
|
||||
print "</ul><br>\n";
|
||||
}
|
||||
else {
|
||||
# Do them one by one in a loop
|
||||
foreach my $ps (@pkgs) {
|
||||
($p, $s) = split(/\//, $ps);
|
||||
next if ($donedep{$p});
|
||||
print &text($msg, "<tt>$p</tt>"),"<br>\n";
|
||||
print "<ul>\n";
|
||||
@pgot = &package_install($p, $s);
|
||||
foreach $g (@pgot) {
|
||||
$donedep{$g}++;
|
||||
}
|
||||
push(@got, @pgot);
|
||||
print "</ul><br>\n";
|
||||
}
|
||||
}
|
||||
if (@got) {
|
||||
print &text('update_ok', scalar(@got)),"<p>\n";
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ sub list_update_system_commands
|
||||
return ($yum_command);
|
||||
}
|
||||
|
||||
# update_system_install([package], [&in])
|
||||
# update_system_install([packages], [&in])
|
||||
# Install some package with yum
|
||||
sub update_system_install
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user