[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] Term::ReadKey in test/run
From: |
John Vandenberg |
Subject: |
[Quilt-dev] Term::ReadKey in test/run |
Date: |
Tue, 6 Sep 2005 17:48:06 +1000 |
Hi,
Could the following patch be applied to allow test/run to work without
Term::ReadKey? It isnt installed by default on several unix/linux
favours I have run into, and I haven't found a way to compile it into
MSYS perl.
Index: quilt/test/run
===================================================================
--- quilt.orig/test/run
+++ quilt/test/run
@@ -13,11 +13,25 @@ use strict;
use FileHandle;
use Getopt::Std;
use POSIX qw(isatty setuid);
-use Term::ReadKey;
use vars qw($opt_l $opt_v);
+BEGIN {
+ my $mod = 'Term::ReadKey';
+ if (eval "require $mod") {
+ $mod->import();
+ }
+ else {
+ eval 'sub GetTerminalSize() {
+ my @rv;
+ push @rv, $ENV{COLUMNS} || 80;
+ return @rv;
+ }';
+ }
+}
+
no warnings qw(taint);
--
John
- [Quilt-dev] Term::ReadKey in test/run,
John Vandenberg <=
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/06
- Re: [Quilt-dev] Term::ReadKey in test/run, John Vandenberg, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Andreas Gruenbacher, 2005/09/23
- Re: [Quilt-dev] Term::ReadKey in test/run, Jean Delvare, 2005/09/23