From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1783B63325 for ; Wed, 15 Jul 2020 13:55:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0FEAB2F41E for ; Wed, 15 Jul 2020 13:54:53 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 582682F410 for ; Wed, 15 Jul 2020 13:54:52 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0E2B044141 for ; Wed, 15 Jul 2020 13:54:52 +0200 (CEST) Date: Wed, 15 Jul 2020 13:54:50 +0200 From: Stoiko Ivanov To: Moayad Almalat Cc: pmg-devel@pve.proxmox.com Message-ID: <20200715135450.54f14d13@rosa.proxmox.com> In-Reply-To: <20200707070954.58356-1-m.almalat@proxmox.com> References: <20200707070954.58356-1-m.almalat@proxmox.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pmgupgrade.pm, apt.pm, nodes.pm] Subject: Re: [pmg-devel] [PATCH pmg-api] Replace apt-get to apt X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2020 11:55:23 -0000 Thanks for the patch! looks mostly good - one tiny nit: When running `apt update` 'in a script' (i.e. stdout not being a terminal) it prints a warning: WARNING: apt does not have a stable CLI interface. Use with caution in scripts. It's just cosmetic - but I think it might be worth to change the invocation to: `apt --option "Apt::Cmd::Disable-Script-Warning=true" update` (found by grepping in the apt source..) apart from that (feel free to pick both tags up for a v3): Reviewed-By: Stoiko Ivanov Tested-By: Stoiko Ivanov On Tue, 7 Jul 2020 09:09:54 +0200 Moayad Almalat wrote: > Signed-off-by: Moayad Almalat > --- > src/PMG/API2/APT.pm | 6 +++--- > src/PMG/API2/Nodes.pm | 2 +- > src/PMG/CLI/pmgupgrade.pm | 6 +++--- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/src/PMG/API2/APT.pm b/src/PMG/API2/APT.pm > index 51b998f..ae14fdf 100644 > --- a/src/PMG/API2/APT.pm > +++ b/src/PMG/API2/APT.pm > @@ -269,7 +269,7 @@ __PACKAGE__->register_method({ > name => 'update_database', > path => 'update', > method => 'POST', > - description => "This is used to resynchronize the package index files from their sources (apt-get update).", > + description => "This is used to resynchronize the package index files from their sources (apt update).", > protected => 1, > proxyto => 'node', > permissions => { check => [ 'admin' ] }, > @@ -314,9 +314,9 @@ __PACKAGE__->register_method({ > my $aptcfn = "/etc/apt/apt.conf.d/76pmgproxy"; > PVE::Tools::file_set_contents($aptcfn, $aptconf); > > - my $cmd = ['apt-get', 'update']; > + my $cmd = ['apt', 'update']; > > - print "starting apt-get update\n" if !$param->{quiet}; > + print "starting apt update\n" if !$param->{quiet}; > > if ($param->{quiet}) { > PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}); > diff --git a/src/PMG/API2/Nodes.pm b/src/PMG/API2/Nodes.pm > index 96aa146..9b7ad51 100644 > --- a/src/PMG/API2/Nodes.pm > +++ b/src/PMG/API2/Nodes.pm > @@ -341,7 +341,7 @@ __PACKAGE__->register_method ({ > node => get_standard_option('pve-node'), > upgrade => { > type => 'boolean', > - description => "Run 'apt-get dist-upgrade' instead of normal shell.", > + description => "Run 'apt dist-upgrade' instead of normal shell.", > optional => 1, > default => 0, > }, > diff --git a/src/PMG/CLI/pmgupgrade.pm b/src/PMG/CLI/pmgupgrade.pm > index 50fbcbd..6e9926a 100755 > --- a/src/PMG/CLI/pmgupgrade.pm > +++ b/src/PMG/CLI/pmgupgrade.pm > @@ -47,13 +47,13 @@ __PACKAGE__->register_method ({ > return undef; > } > > - my $cmdstr = 'apt-get dist-upgrade'; > + my $cmdstr = 'apt dist-upgrade'; > > - print "Starting system upgrade: apt-get dist-upgrade\n"; > + print "Starting system upgrade: apt dist-upgrade\n"; > > my $oldlist = PMG::API2::APT->list_updates({ node => $nodename}); > > - system('apt-get', 'dist-upgrade'); > + system('apt', 'dist-upgrade'); > > my $pkglist = PMG::API2::APT->list_updates({ node => $nodename}); >