OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 12-Mar-2004 18:06:41
Branch: HEAD Handle: 2004031217064100
Added files:
openpkg-src/perl-term perl-term.patch
Modified files:
openpkg-src/perl-term perl-term.spec
Log:
add improvement to shadow redrawing to solve my issues on the bastion
host login prompt
Summary:
Revision Changes Path
1.1 +38 -0 openpkg-src/perl-term/perl-term.patch
1.41 +3 -1 openpkg-src/perl-term/perl-term.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/perl-term/perl-term.patch
============================================================================
$ cvs diff -u -r0 -r1.1 perl-term.patch
--- /dev/null 2004-03-12 18:06:41.000000000 +0100
+++ perl-term.patch 2004-03-12 18:06:41.000000000 +0100
@@ -0,0 +1,38 @@
+I don't know why, but under some circumstances (usually in an SSH
+session within an xterm), Term::ReadLine::Gnu things that a TERM=xterm
+does not provide the "le" sequence. OTOH the "cr" and "ce" sequences are
+fully enough for the task of providing a password/shadow style prompt.
+So, for positioning the cursor in the middle of the prompt, instead of
+using left-spacing we just redraw (over the full line) the part of the
+line left to the cursor.
+
+Index: Term-ReadLine-Gnu-1.14/Gnu/XS.pm
+--- Term-ReadLine-Gnu-1.14/Gnu/XS.pm.orig 2002-07-28 05:41:36.000000000 +0200
++++ Term-ReadLine-Gnu-1.14/Gnu/XS.pm 2004-03-12 17:55:16.000000000 +0100
+@@ -429,21 +429,20 @@
+ print $OUT ($_tstrs[0], # carriage return
+ $_tstrs[1], # clear to EOL
+ $prompt, '*' x length($Attribs{line_buffer}));
+- print $OUT ($_tstrs[2] # cursor left
+- x (length($Attribs{line_buffer}) - $Attribs{point}));
++ print $OUT ($_tstrs[0], # carriage return
++ $prompt, '*' x $Attribs{point});
+ $oldfh = select($OUT); $| = 0; select($oldfh);
+ }
+
+ sub _tgetstrs {
+ my @s = (tgetstr('cr'), # carriage return
+- tgetstr('ce'), # clear to EOL
+- tgetstr('le')); # cursor left
+- warn <<"EOM" unless (defined($s[0]) && defined($s[1]) && defined($s[2]));
++ tgetstr('ce')); # clear to EOL
++ warn <<"EOM" unless (defined($s[0]) && defined($s[1]));
+ Your terminal 'TERM=$ENV{TERM}' does not support enough function.
+ Check if your environment variable 'TERM' is set correctly.
+ EOM
+ # suppress warning "Use of uninitialized value in print at ..."
+- $s[0] = $s[0] || ''; $s[1] = $s[1] || ''; $s[2] = $s[2] || '';
++ $s[0] = $s[0] || ''; $s[1] = $s[1] || '';
+ $_tstrs_init = 1;
+ return @s;
+ }
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/perl-term/perl-term.spec
============================================================================
$ cvs diff -u -r1.40 -r1.41 perl-term.spec
--- openpkg-src/perl-term/perl-term.spec 20 Feb 2004 19:12:02 -0000 1.40
+++ openpkg-src/perl-term/perl-term.spec 12 Mar 2004 17:06:41 -0000 1.41
@@ -47,7 +47,7 @@
Group: Language
License: GPL/Artistic
Version: %{V_perl}
-Release: 20040220
+Release: 20040312
# list of sources
Source0:
http://www.cpan.org/modules/by-module/Term/TermReadKey-%{V_term_readkey}.tar.gz
@@ -60,6 +60,7 @@
Source7: http://www.cpan.org/modules/by-module/IO/IO-Stty-%{V_io_stty}.tar.gz
Source8:
http://www.cpan.org/modules/by-module/Term/Term-ReadLine-Perl-%{V_term_readline_perl}.tar.gz
Source9:
http://www.cpan.org/modules/by-module/Term/Term-ReadLine-Gnu-%{V_term_readline_gnu}.tar.gz
+Patch0: perl-term.patch
# build information
Prefix: %{l_prefix}
@@ -148,6 +149,7 @@
%setup -q -T -D -a 7
%setup -q -T -D -a 8
%setup -q -T -D -a 9
+ %patch -p0
%build
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]