all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api v2] api: replace apt-get to apt
@ 2020-07-21 12:30 Moayad Almalat
  0 siblings, 0 replies; only message in thread
From: Moayad Almalat @ 2020-07-21 12:30 UTC (permalink / raw)
  To: pmg-devel

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..22c0f1a 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 --option Apt::Cmd::Disable-Script-Warning=true update';
 
-	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 --option Apt::Cmd::Disable-Script-Warning=true dist-upgrade');
 
 	my $pkglist = PMG::API2::APT->list_updates({ node => $nodename});
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-21 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 12:30 [pmg-devel] [PATCH pmg-api v2] api: replace apt-get to apt Moayad Almalat

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