From f460dc12b167a17996865b5fdb7fd02e561080b3 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 2 Aug 2013 06:33:36 +0200 Subject: [PATCH] impl. a better way to suppress output from apt-get update. --- PVE/API2/APT.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm index e4ddda43..cfd975e9 100644 --- a/PVE/API2/APT.pm +++ b/PVE/API2/APT.pm @@ -275,11 +275,13 @@ __PACKAGE__->register_method({ my $cmd = ['apt-get', 'update']; - push @$cmd, '-qq' if $param->{quiet}; - print "starting apt-get update\n" if !$param->{quiet}; - PVE::Tools::run_command($cmd); + if ($param->{quiet}) { + PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}); + } else { + PVE::Tools::run_command($cmd); + } my $pkglist = &$update_pve_pkgstatus();