public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 2/3] remove dependency on Term::ReadLine (see #2077)
Date: Mon,  9 May 2022 09:30:33 +0200	[thread overview]
Message-ID: <20220509073034.822117-3-s.hrdlicka@proxmox.com> (raw)
In-Reply-To: <20220509073034.822117-1-s.hrdlicka@proxmox.com>

depends on change in pve-common

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
---
 PVE/CLI/pvenode.pm | 12 ++++--------
 debian/control     |  1 -
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index acef6c3b..383e1f81 100644
--- a/PVE/CLI/pvenode.pm
+++ b/PVE/CLI/pvenode.pm
@@ -22,8 +22,6 @@ use PVE::CLIFormatter;
 use PVE::RESTHandler;
 use PVE::CLIHandler;
 
-use Term::ReadLine;
-
 use base qw(PVE::CLIHandler);
 
 my $nodename = PVE::INotify::nodename();
@@ -93,13 +91,12 @@ __PACKAGE__->register_method({
 	    }
 	    print $i, ") Custom\n";
 
-	    my $term = Term::ReadLine->new('pvenode');
 	    my $get_dir_selection = sub {
-		my $selection = $term->readline("Enter selection: ");
-		if ($selection =~ /^(\d+)$/) {
+		my $selection = PVE::PTY::read_input("Enter selection: ");
+		if ($selection =~ /^([0-9]+)$/) {
 		    $selection = $1;
 		    if ($selection == $i) {
-			$param->{directory} = $term->readline("Enter custom URL: ");
+			$param->{directory} = PVE::PTY::read_input("Enter custom URL: ");
 			return;
 		    } elsif ($selection < $i && $selection >= 0) {
 			$param->{directory} = $directories->[$selection]->{url};
@@ -120,8 +117,7 @@ __PACKAGE__->register_method({
 	my $tos = PVE::API2::ACMEAccount->get_tos({ directory => $param->{directory} });
 	if ($tos) {
 	    print "Terms of Service: $tos\n";
-	    my $term = Term::ReadLine->new('pvenode');
-	    my $agreed = $term->readline('Do you agree to the above terms? [y|N]: ');
+	    my $agreed = PVE::PTY::read_input('Do you agree to the above terms? [y|N]: ');
 	    die "Cannot continue without agreeing to ToS, aborting.\n"
 		if ($agreed !~ /^y$/i);
 
diff --git a/debian/control b/debian/control
index f48a38d0..6bb442fd 100644
--- a/debian/control
+++ b/debian/control
@@ -62,7 +62,6 @@ Depends: apt-transport-https | apt (>= 1.5~),
          libpve-storage-perl (>= 7.1-2),
          librados2-perl,
          libtemplate-perl,
-         libterm-readline-gnu-perl,
          liburi-perl,
          libuuid-perl,
          libwww-perl (>= 6.04-1),
-- 
2.30.2




  parent reply	other threads:[~2022-05-09  7:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09  7:30 [pve-devel] [PATCH pve-common 0/3] remove dependency on Term::ReadLine Stefan Hrdlicka
2022-05-09  7:30 ` [pve-devel] [PATCH pve-common 1/3] remove dependency on Term::ReadLine (see #2077) Stefan Hrdlicka
2022-05-09  7:30 ` Stefan Hrdlicka [this message]
2022-05-09  7:30 ` [pve-devel] [PATCH qemu-server 3/3] " Stefan Hrdlicka

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=20220509073034.822117-3-s.hrdlicka@proxmox.com \
    --to=s.hrdlicka@proxmox.com \
    --cc=pve-devel@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal