1 |
commit: 643430df185f46339d7eaa13933eb11fff76f57d |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Mar 3 02:40:04 2018 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 3 02:40:52 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=643430df |
7 |
|
8 |
dev-perl/Term-ReadLine-TTYtter: Fix interactive tests bug #624044 |
9 |
|
10 |
- EAPI6 |
11 |
- Tidy metadata.xml |
12 |
- Add upstream remote-id's |
13 |
- Patch out interactive tests while retaining some exectuable |
14 |
functionality testing |
15 |
- Normalize version |
16 |
|
17 |
Bug: https://bugs.gentoo.org/624044 |
18 |
Package-Manager: Portage-2.3.18, Repoman-2.3.6 |
19 |
|
20 |
.../Term-ReadLine-TTYtter-1.400.0-r1.ebuild | 18 +++++ |
21 |
.../Term-ReadLine-TTYtter-1.4-nointeractive.patch | 78 ++++++++++++++++++++++ |
22 |
dev-perl/Term-ReadLine-TTYtter/metadata.xml | 32 +++++---- |
23 |
3 files changed, 116 insertions(+), 12 deletions(-) |
24 |
|
25 |
diff --git a/dev-perl/Term-ReadLine-TTYtter/Term-ReadLine-TTYtter-1.400.0-r1.ebuild b/dev-perl/Term-ReadLine-TTYtter/Term-ReadLine-TTYtter-1.400.0-r1.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..4ff8c314430 |
28 |
--- /dev/null |
29 |
+++ b/dev-perl/Term-ReadLine-TTYtter/Term-ReadLine-TTYtter-1.400.0-r1.ebuild |
30 |
@@ -0,0 +1,18 @@ |
31 |
+# Copyright 1999-2018 Gentoo Foundation |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=6 |
35 |
+ |
36 |
+DIST_AUTHOR=CKAISER |
37 |
+DIST_VERSION=1.4 |
38 |
+ |
39 |
+inherit perl-module |
40 |
+ |
41 |
+DESCRIPTION="Quick implementation of readline utilities for ttytter" |
42 |
+ |
43 |
+SLOT="0" |
44 |
+KEYWORDS="~amd64 ~x86" |
45 |
+IUSE="" |
46 |
+ |
47 |
+PATCHES=( "${FILESDIR}/${PN}-1.4-nointeractive.patch" ) |
48 |
+RDEPEND="dev-perl/TermReadKey" |
49 |
|
50 |
diff --git a/dev-perl/Term-ReadLine-TTYtter/files/Term-ReadLine-TTYtter-1.4-nointeractive.patch b/dev-perl/Term-ReadLine-TTYtter/files/Term-ReadLine-TTYtter-1.4-nointeractive.patch |
51 |
new file mode 100644 |
52 |
index 00000000000..81050510252 |
53 |
--- /dev/null |
54 |
+++ b/dev-perl/Term-ReadLine-TTYtter/files/Term-ReadLine-TTYtter-1.4-nointeractive.patch |
55 |
@@ -0,0 +1,78 @@ |
56 |
+From ec0b1fd3853df6cb577a99382cbcfd7ecc85d372 Mon Sep 17 00:00:00 2001 |
57 |
+From: Kent Fredric <kentnl@g.o> |
58 |
+Date: Wed, 28 Feb 2018 09:50:13 +1300 |
59 |
+Subject: Use file for input data instead of STDIN ( non-interactive testing ) |
60 |
+ |
61 |
+test.pl as-is is useless because it executes no readline code when in |
62 |
+automated testing conditions. |
63 |
+ |
64 |
+Additionally, attempting to use the built-in file redirection |
65 |
+mechanisms is useless, as there's no way to set those parts from |
66 |
+ |
67 |
+ make test |
68 |
+ |
69 |
+And 'preput' support causes readline to barf when the input stream |
70 |
+is not a real TTY. |
71 |
+ |
72 |
+Subsequently, the pre-inserted "exit" also has to be removed. |
73 |
+ |
74 |
+Bug: https://bugs.gentoo.org/624044 |
75 |
+--- |
76 |
+ t/input.txt | 2 ++ |
77 |
+ test.pl | 23 +++-------------------- |
78 |
+ 2 files changed, 5 insertions(+), 20 deletions(-) |
79 |
+ create mode 100644 t/input.txt |
80 |
+ |
81 |
+diff --git a/t/input.txt b/t/input.txt |
82 |
+new file mode 100644 |
83 |
+index 0000000..6077553 |
84 |
+--- /dev/null |
85 |
++++ b/t/input.txt |
86 |
+@@ -0,0 +1,2 @@ |
87 |
++printf "input ok: sqrt(42)^2 == %20.20f", sqrt(42) * sqrt(42); |
88 |
++exit 0 |
89 |
+diff --git a/test.pl b/test.pl |
90 |
+index fe99e2f..1f87749 100644 |
91 |
+--- a/test.pl |
92 |
++++ b/test.pl |
93 |
+@@ -10,26 +10,9 @@ use Term::ReadLine; |
94 |
+ use Carp; |
95 |
+ $SIG{__WARN__} = sub { warn Carp::longmess(@_) }; |
96 |
+ |
97 |
+-my $ev; |
98 |
+-if ($ENV{$ev = 'AUTOMATED_TESTING'} or $ENV{$ev = 'PERL_MM_NONINTERACTIVE'}) { |
99 |
+- print "1..0 # skip: \$ENV{$ev} is TRUE\n"; |
100 |
+- exit; |
101 |
+-} |
102 |
++open(IN, '<', './t/input.txt') or die "Can't open input.txt, $@, $!"; |
103 |
++$term = Term::ReadLine->new('Simple Perl calc', \*IN, \*STDOUT); |
104 |
+ |
105 |
+-if (!@ARGV) { |
106 |
+- $term = new Term::ReadLine 'Simple Perl calc'; |
107 |
+-} elsif (@ARGV == 2) { |
108 |
+- open(IN,"<$ARGV[0]"); |
109 |
+- open(OUT,">$ARGV[1]"); |
110 |
+- $term = new Term::ReadLine 'Simple Perl calc', \*IN, \*OUT; |
111 |
+-} elsif ($ARGV[0] =~ m|^/dev|) { |
112 |
+- open(IN,"<$ARGV[0]"); |
113 |
+- open(OUT,">$ARGV[0]"); |
114 |
+- $term = new Term::ReadLine 'Simple Perl calc', \*IN, \*OUT; |
115 |
+-} else { |
116 |
+- $term = new Term::ReadLine 'Simple Perl calc', \*STDIN, \*STDOUT; |
117 |
+- $no_print = $ARGV[0] eq '--no-print'; |
118 |
+-} |
119 |
+ $prompt = "Enter arithmetic or Perl expression: "; |
120 |
+ if ((my $l = $ENV{PERL_RL_TEST_PROMPT_MINLEN} || 0) > length $prompt) { |
121 |
+ $prompt =~ s/(?=:)/ ' ' x ($l - length $prompt)/e; |
122 |
+@@ -60,7 +43,7 @@ print $OUT <<EOP; |
123 |
+ this word should be already entered.) |
124 |
+ |
125 |
+ EOP |
126 |
+-while ( defined ($_ = $term->readline($prompt, "exit")) ) { |
127 |
++while ( defined ($_ = $term->readline($prompt)) ) { |
128 |
+ $res = eval($_); |
129 |
+ warn $@ if $@; |
130 |
+ print $OUT $res, "\n" unless $@ or $no_print; |
131 |
+-- |
132 |
+2.15.1 |
133 |
+ |
134 |
|
135 |
diff --git a/dev-perl/Term-ReadLine-TTYtter/metadata.xml b/dev-perl/Term-ReadLine-TTYtter/metadata.xml |
136 |
index 87b984b5eb8..c1dbc5646cf 100644 |
137 |
--- a/dev-perl/Term-ReadLine-TTYtter/metadata.xml |
138 |
+++ b/dev-perl/Term-ReadLine-TTYtter/metadata.xml |
139 |
@@ -1,16 +1,24 @@ |
140 |
<?xml version="1.0" encoding="UTF-8"?> |
141 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
142 |
<pkgmetadata> |
143 |
-<maintainer type="person"> |
144 |
-<email>gentoo@×××××××.org</email> |
145 |
-<name>Peter Gantner</name> |
146 |
-</maintainer> |
147 |
-<maintainer type="project"> |
148 |
-<email>perl@g.o</email> |
149 |
-<name>Gentoo Perl Project</name> |
150 |
-</maintainer> |
151 |
-<maintainer type="project"> |
152 |
-<email>proxy-maint@g.o</email> |
153 |
-<name>Proxy Maintainers</name> |
154 |
-</maintainer> |
155 |
+ <maintainer type="person"> |
156 |
+ <email>gentoo@×××××××.org</email> |
157 |
+ <name>Peter Gantner</name> |
158 |
+ </maintainer> |
159 |
+ <maintainer type="project"> |
160 |
+ <email>perl@g.o</email> |
161 |
+ <name>Gentoo Perl Project</name> |
162 |
+ </maintainer> |
163 |
+ <maintainer type="project"> |
164 |
+ <email>proxy-maint@g.o</email> |
165 |
+ <name>Proxy Maintainers</name> |
166 |
+ </maintainer> |
167 |
+ <upstream> |
168 |
+ <remote-id type="cpan">Term-ReadLine-TTYtter</remote-id> |
169 |
+ <remote-id type="cpan-module">Term::ReadLine::TTYtter</remote-id> |
170 |
+ <remote-id type="cpan-module">Term::ReadLine::TTYtter::AU</remote-id> |
171 |
+ <remote-id type="cpan-module">Term::ReadLine::TTYtter::Compa</remote-id> |
172 |
+ <remote-id type="cpan-module">Term::ReadLine::TTYtter::Tie</remote-id> |
173 |
+ <remote-id type="cpan-module">readline_ttytter</remote-id> |
174 |
+ </upstream> |
175 |
</pkgmetadata> |