* Sat Apr 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-4.sme

- remove whiptail [SME: 8275]
This commit is contained in:
Jean-Philippe Pialasse 2024-04-13 04:21:57 -04:00
parent 9d4fc92fe6
commit dffd09d054
2 changed files with 10 additions and 27 deletions

View File

@ -23,7 +23,7 @@ esmith::console - A class to provide a backend library to the server console.
=head1 DESCRIPTION =head1 DESCRIPTION
This class provides a backend library of methods for the frontend console on This class provides a backend library of methods for the frontend console on
the server. The intent is that all of the whiptail code is hidden in this the server. The intent is that all of the dialog code is hidden in this
library, and the frontend can just concern itself with the logical progression library, and the frontend can just concern itself with the logical progression
through any and all applicable screens. through any and all applicable screens.
@ -104,7 +104,7 @@ sub new
=head2 screen and dialog =head2 screen and dialog
These method are wrappers around whiptail and dialog, and permit the creation These method are wrappers around dialog, and permit the creation
of custom screens depending on the arguments passed. They are typically not of custom screens depending on the arguments passed. They are typically not
called directly, but are used by all of the other page methods that called directly, but are used by all of the other page methods that
follow. You should only call these method directly if none of the other follow. You should only call these method directly if none of the other
@ -122,11 +122,6 @@ sub dialog
_screen(shift, "/usr/bin/dialog", @_); _screen(shift, "/usr/bin/dialog", @_);
} }
sub whiptail
{
_screen(shift, "/usr/bin/whiptail", @_);
}
sub _screen sub _screen
{ {
my $self = shift; my $self = shift;
@ -159,28 +154,13 @@ sub _screen
close READER close READER
or die gettext("Couldn't close reading end of pipe") , ": $!\n"; or die gettext("Couldn't close reading end of pipe") , ": $!\n";
if ($whiptail =~ m{\bwhiptail$} ) { use Fcntl qw/F_SETFD/;
# whiptail sends its output via STDERR. We temporarily
# shut off warnings so they don't interfere with that.
local $^W = 0;
open STDERR, ">& WRITER" # Clear close-on-exec on WRITER so that it stays open for dialog to use
or die gettext("Couldn't connect STDERR to pipe"), ": $!\n"; fcntl(WRITER, F_SETFD, 0);
close WRITER unshift @whiptailArgs, $whiptail,
or die gettext("Couldn't close writing end of pipe"), ": $!\n";
unshift @whiptailArgs, $whiptail,
'--backtitle', $self->backtitle;
} else {
use Fcntl qw/F_SETFD/;
# Clear close-on-exec on WRITER so that it stays open for dialog to use
fcntl(WRITER, F_SETFD, 0);
unshift @whiptailArgs, $whiptail,
'--backtitle', $self->backtitle, "--output-fd", fileno(WRITER); '--backtitle', $self->backtitle, "--output-fd", fileno(WRITER);
}
exec @whiptailArgs; exec @whiptailArgs;
die gettext("Couldn't exec:"), ": $!\n"; die gettext("Couldn't exec:"), ": $!\n";
} }

View File

@ -6,7 +6,7 @@ Summary: smeserver server and gateway - library module
%define name smeserver-lib %define name smeserver-lib
Name: %{name} Name: %{name}
%define version 11.0.0 %define version 11.0.0
%define release 3 %define release 4
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
License: Artistic License: Artistic
@ -33,6 +33,9 @@ Provides: e-smith-lib
smeserver server and gateway software - library module. smeserver server and gateway software - library module.
%changelog %changelog
* Sat Apr 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-4.sme
- remove whiptail [SME: 8275]
* Thu Apr 04 2024 Brian Read <brianr@koozali.org> 11.0.0-3.sme * Thu Apr 04 2024 Brian Read <brianr@koozali.org> 11.0.0-3.sme
- Set license file to GPL2.0 [SME: 12577] - Set license file to GPL2.0 [SME: 12577]