From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 3/4] partially fix #2077: remove dependency on Term::ReadLine
Date: Thu, 18 Sep 2025 15:50:55 +0200 [thread overview]
Message-ID: <20250918135215.95188-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250918135215.95188-1-f.ebner@proxmox.com>
As a side-effect, this also fixes #6748.
Originally-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
[FE: rebase and adapt to rename]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
Dependency bump for pve-common needed.
PVE/CLI/pvenode.pm | 19 +++++++------------
debian/control | 1 -
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index 76b05887..7f717642 100644
--- a/PVE/CLI/pvenode.pm
+++ b/PVE/CLI/pvenode.pm
@@ -21,8 +21,7 @@ use PVE::RPCEnvironment;
use PVE::CLIFormatter;
use PVE::RESTHandler;
use PVE::CLIHandler;
-
-use Term::ReadLine;
+use PVE::PTY;
use base qw(PVE::CLIHandler);
@@ -108,13 +107,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: ");
+ my $selection = PVE::PTY::read_line("Enter selection: ");
if ($selection =~ /^(\d+)$/) {
$selection = $1;
if ($selection == $i) {
- $param->{directory} = $term->readline("Enter custom URL: ");
+ $param->{directory} = PVE::PTY::read_line("Enter custom URL: ");
$custom_directory = 1;
return;
} elsif ($selection < $i && $selection >= 0) {
@@ -137,8 +135,7 @@ __PACKAGE__->register_method({
if ($meta->{termsOfService}) {
my $tos = $meta->{termsOfService};
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_line('Do you agree to the above terms? [y|N]: ');
die "Cannot continue without agreeing to ToS, aborting.\n"
if ($agreed !~ /^y$/i);
@@ -149,18 +146,16 @@ __PACKAGE__->register_method({
my $eab_enabled = $meta->{externalAccountRequired};
if (!$eab_enabled && $custom_directory) {
- my $term = Term::ReadLine->new('pvenode');
my $agreed =
- $term->readline('Do you want to use external account binding? [y|N]: ');
+ PVE::PTY::read_line('Do you want to use external account binding? [y|N]: ');
$eab_enabled = ($agreed =~ /^y$/i);
} elsif ($eab_enabled) {
print "The CA requires external account binding.\n";
}
if ($eab_enabled) {
print "You should have received a key id and a key from your CA.\n";
- my $term = Term::ReadLine->new('pvenode');
- my $eab_kid = $term->readline('Enter EAB key id: ');
- my $eab_hmac_key = $term->readline('Enter EAB key: ');
+ my $eab_kid = PVE::PTY::read_line('Enter EAB key id: ');
+ my $eab_hmac_key = PVE::PTY::read_line('Enter EAB key: ');
$param->{'eab-kid'} = $eab_kid;
$param->{'eab-hmac-key'} = $eab_hmac_key;
diff --git a/debian/control b/debian/control
index 64b942ce..4d589beb 100644
--- a/debian/control
+++ b/debian/control
@@ -70,7 +70,6 @@ Depends: apt (>= 1.5~),
libpve-storage-perl (>= 9.0.5),
librados2-perl (>= 1.3-1),
libtemplate-perl,
- libterm-readline-gnu-perl,
liburi-perl,
libuuid-perl,
libwww-perl (>= 6.04-1),
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-18 13:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 13:50 [pve-devel] [PATCH-SERIES common/manager/qemu-server 0/4] " Fiona Ebner
2025-09-18 13:50 ` [pve-devel] [PATCH common 1/4] pty: introduce read_line() function Fiona Ebner
2025-09-18 13:50 ` [pve-devel] [RFC common 2/4] developer readme: remove libterm-readline-gnu-perl dependency Fiona Ebner
2025-09-18 14:12 ` Fiona Ebner
2025-09-18 13:50 ` Fiona Ebner [this message]
2025-09-18 13:50 ` [pve-devel] [RFC qemu-server 4/4] partially fix #2077: remove dependency on Term::ReadLine Fiona Ebner
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=20250918135215.95188-4-f.ebner@proxmox.com \
--to=f.ebner@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