diff options
author | Kent Fredric <kentnl@gentoo.org> | 2018-03-03 15:40:04 +1300 |
---|---|---|
committer | Kent Fredric <kentnl@gentoo.org> | 2018-03-03 15:40:52 +1300 |
commit | 643430df185f46339d7eaa13933eb11fff76f57d (patch) | |
tree | da11b709d5c85f35e1592007f6af217fdfc11f6d /dev-perl/Term-ReadLine-TTYtter | |
parent | net-misc/ubridge: New package (diff) | |
download | gentoo-643430df185f46339d7eaa13933eb11fff76f57d.tar.gz gentoo-643430df185f46339d7eaa13933eb11fff76f57d.tar.bz2 gentoo-643430df185f46339d7eaa13933eb11fff76f57d.zip |
dev-perl/Term-ReadLine-TTYtter: Fix interactive tests bug #624044
- EAPI6
- Tidy metadata.xml
- Add upstream remote-id's
- Patch out interactive tests while retaining some exectuable
functionality testing
- Normalize version
Bug: https://bugs.gentoo.org/624044
Package-Manager: Portage-2.3.18, Repoman-2.3.6
Diffstat (limited to 'dev-perl/Term-ReadLine-TTYtter')
3 files changed, 116 insertions, 12 deletions
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 new file mode 100644 index 000000000000..4ff8c3144302 --- /dev/null +++ b/dev-perl/Term-ReadLine-TTYtter/Term-ReadLine-TTYtter-1.400.0-r1.ebuild @@ -0,0 +1,18 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DIST_AUTHOR=CKAISER +DIST_VERSION=1.4 + +inherit perl-module + +DESCRIPTION="Quick implementation of readline utilities for ttytter" + +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +PATCHES=( "${FILESDIR}/${PN}-1.4-nointeractive.patch" ) +RDEPEND="dev-perl/TermReadKey" 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 new file mode 100644 index 000000000000..81050510252b --- /dev/null +++ b/dev-perl/Term-ReadLine-TTYtter/files/Term-ReadLine-TTYtter-1.4-nointeractive.patch @@ -0,0 +1,78 @@ +From ec0b1fd3853df6cb577a99382cbcfd7ecc85d372 Mon Sep 17 00:00:00 2001 +From: Kent Fredric <kentnl@gentoo.org> +Date: Wed, 28 Feb 2018 09:50:13 +1300 +Subject: Use file for input data instead of STDIN ( non-interactive testing ) + +test.pl as-is is useless because it executes no readline code when in +automated testing conditions. + +Additionally, attempting to use the built-in file redirection +mechanisms is useless, as there's no way to set those parts from + + make test + +And 'preput' support causes readline to barf when the input stream +is not a real TTY. + +Subsequently, the pre-inserted "exit" also has to be removed. + +Bug: https://bugs.gentoo.org/624044 +--- + t/input.txt | 2 ++ + test.pl | 23 +++-------------------- + 2 files changed, 5 insertions(+), 20 deletions(-) + create mode 100644 t/input.txt + +diff --git a/t/input.txt b/t/input.txt +new file mode 100644 +index 0000000..6077553 +--- /dev/null ++++ b/t/input.txt +@@ -0,0 +1,2 @@ ++printf "input ok: sqrt(42)^2 == %20.20f", sqrt(42) * sqrt(42); ++exit 0 +diff --git a/test.pl b/test.pl +index fe99e2f..1f87749 100644 +--- a/test.pl ++++ b/test.pl +@@ -10,26 +10,9 @@ use Term::ReadLine; + use Carp; + $SIG{__WARN__} = sub { warn Carp::longmess(@_) }; + +-my $ev; +-if ($ENV{$ev = 'AUTOMATED_TESTING'} or $ENV{$ev = 'PERL_MM_NONINTERACTIVE'}) { +- print "1..0 # skip: \$ENV{$ev} is TRUE\n"; +- exit; +-} ++open(IN, '<', './t/input.txt') or die "Can't open input.txt, $@, $!"; ++$term = Term::ReadLine->new('Simple Perl calc', \*IN, \*STDOUT); + +-if (!@ARGV) { +- $term = new Term::ReadLine 'Simple Perl calc'; +-} elsif (@ARGV == 2) { +- open(IN,"<$ARGV[0]"); +- open(OUT,">$ARGV[1]"); +- $term = new Term::ReadLine 'Simple Perl calc', \*IN, \*OUT; +-} elsif ($ARGV[0] =~ m|^/dev|) { +- open(IN,"<$ARGV[0]"); +- open(OUT,">$ARGV[0]"); +- $term = new Term::ReadLine 'Simple Perl calc', \*IN, \*OUT; +-} else { +- $term = new Term::ReadLine 'Simple Perl calc', \*STDIN, \*STDOUT; +- $no_print = $ARGV[0] eq '--no-print'; +-} + $prompt = "Enter arithmetic or Perl expression: "; + if ((my $l = $ENV{PERL_RL_TEST_PROMPT_MINLEN} || 0) > length $prompt) { + $prompt =~ s/(?=:)/ ' ' x ($l - length $prompt)/e; +@@ -60,7 +43,7 @@ print $OUT <<EOP; + this word should be already entered.) + + EOP +-while ( defined ($_ = $term->readline($prompt, "exit")) ) { ++while ( defined ($_ = $term->readline($prompt)) ) { + $res = eval($_); + warn $@ if $@; + print $OUT $res, "\n" unless $@ or $no_print; +-- +2.15.1 + diff --git a/dev-perl/Term-ReadLine-TTYtter/metadata.xml b/dev-perl/Term-ReadLine-TTYtter/metadata.xml index 87b984b5eb8e..c1dbc5646cff 100644 --- a/dev-perl/Term-ReadLine-TTYtter/metadata.xml +++ b/dev-perl/Term-ReadLine-TTYtter/metadata.xml @@ -1,16 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> -<maintainer type="person"> -<email>gentoo@nephros.org</email> -<name>Peter Gantner</name> -</maintainer> -<maintainer type="project"> -<email>perl@gentoo.org</email> -<name>Gentoo Perl Project</name> -</maintainer> -<maintainer type="project"> -<email>proxy-maint@gentoo.org</email> -<name>Proxy Maintainers</name> -</maintainer> + <maintainer type="person"> + <email>gentoo@nephros.org</email> + <name>Peter Gantner</name> + </maintainer> + <maintainer type="project"> + <email>perl@gentoo.org</email> + <name>Gentoo Perl Project</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="cpan">Term-ReadLine-TTYtter</remote-id> + <remote-id type="cpan-module">Term::ReadLine::TTYtter</remote-id> + <remote-id type="cpan-module">Term::ReadLine::TTYtter::AU</remote-id> + <remote-id type="cpan-module">Term::ReadLine::TTYtter::Compa</remote-id> + <remote-id type="cpan-module">Term::ReadLine::TTYtter::Tie</remote-id> + <remote-id type="cpan-module">readline_ttytter</remote-id> + </upstream> </pkgmetadata> |