all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Moayad Almalat <m.almalat@proxmox.com>
Cc: pmg-devel@pve.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api] Replace apt-get to apt
Date: Wed, 15 Jul 2020 13:54:50 +0200	[thread overview]
Message-ID: <20200715135450.54f14d13@rosa.proxmox.com> (raw)
In-Reply-To: <20200707070954.58356-1-m.almalat@proxmox.com>

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 <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>


On Tue,  7 Jul 2020 09:09:54 +0200
Moayad Almalat <m.almalat@proxmox.com> wrote:

> Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
> ---
>  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});
>  





           reply	other threads:[~2020-07-15 11:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20200707070954.58356-1-m.almalat@proxmox.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200715135450.54f14d13@rosa.proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=m.almalat@proxmox.com \
    --cc=pmg-devel@pve.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal