Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/tty-screen/, dev-ruby/tty-screen/files/
Date: Mon, 23 Aug 2021 17:38:28
Message-Id: 1629740292.1b7900f916ca8ac513c0393a5811d87e724646c8.graaff@gentoo
1 commit: 1b7900f916ca8ac513c0393a5811d87e724646c8
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 23 17:31:27 2021 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 23 17:38:12 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b7900f9
7
8 dev-ruby/tty-screen: fix ioctl endian test failure
9
10 Closes: https://bugs.gentoo.org/808174
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
13
14 .../files/tty-screen-0.8.1-ioctl-test.patch | 55 ++++++++++++++++++++++
15 dev-ruby/tty-screen/tty-screen-0.8.1.ebuild | 2 +
16 2 files changed, 57 insertions(+)
17
18 diff --git a/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch b/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch
19 new file mode 100644
20 index 00000000000..0933f1f611b
21 --- /dev/null
22 +++ b/dev-ruby/tty-screen/files/tty-screen-0.8.1-ioctl-test.patch
23 @@ -0,0 +1,55 @@
24 +From dba351b178ae06b56985cc77a291918a0fc4aff4 Mon Sep 17 00:00:00 2001
25 +From: Piotr Murach <pmurach@×××××.com>
26 +Date: Mon, 16 Aug 2021 22:13:27 +0200
27 +Subject: [PATCH] Fix ioctl call test to stub terminal size encoding for
28 + big-endian systems
29 +
30 +Fixes #13
31 +---
32 + CHANGELOG.md | 6 ++++++
33 + spec/unit/screen_spec.rb | 8 +++++++-
34 + 2 files changed, 13 insertions(+), 1 deletion(-)
35 +
36 +diff --git a/CHANGELOG.md b/CHANGELOG.md
37 +index 91dd6ab..0f369bd 100644
38 +--- a/CHANGELOG.md
39 ++++ b/CHANGELOG.md
40 +@@ -1,5 +1,10 @@
41 + # Change log
42 +
43 ++## [v0.8.2] - unreleased
44 ++
45 ++### Fixed
46 ++* Fix ioctl call test to stub terminal size encoding for big-endian systems
47 ++
48 + ## [v0.8.1] - 2020-07-17
49 +
50 + ### Fixed
51 +@@ -136,6 +141,7 @@
52 + ### Fixed
53 + * Fix bug with screen detection from_io_console by @luxflux
54 +
55 ++[v0.8.2]: https://github.com/piotrmurach/tty-screen/compare/v0.8.1...v0.8.2
56 + [v0.8.1]: https://github.com/piotrmurach/tty-screen/compare/v0.8.0...v0.8.1
57 + [v0.8.0]: https://github.com/piotrmurach/tty-screen/compare/v0.7.1...v0.8.0
58 + [v0.7.1]: https://github.com/piotrmurach/tty-screen/compare/v0.7.0...v0.7.1
59 +diff --git a/spec/unit/screen_spec.rb b/spec/unit/screen_spec.rb
60 +index 3666a3c..de78ff3 100644
61 +--- a/spec/unit/screen_spec.rb
62 ++++ b/spec/unit/screen_spec.rb
63 +@@ -6,8 +6,14 @@ def winsize
64 + [100, 200]
65 + end
66 +
67 ++ def big_endian?
68 ++ [1].pack("S") == [1].pack("n")
69 ++ end
70 ++
71 + def ioctl(control, buf)
72 +- buf.replace("3\x00\xD3\x00\xF2\x04\xCA\x02\x00")
73 ++ little_endian = "3\x00\xD3\x00\xF2\x04\xCA\x02\x00"
74 ++ big_endian = "\x003\x00\xD3\x04\xF2\x02\xCA"
75 ++ buf.replace(big_endian? ? big_endian : little_endian)
76 + 0
77 + end
78 + end
79
80 diff --git a/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild b/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
81 index 7f105f6ddd5..24ccfbc41f7 100644
82 --- a/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
83 +++ b/dev-ruby/tty-screen/tty-screen-0.8.1.ebuild
84 @@ -23,6 +23,8 @@ SLOT="0"
85 KEYWORDS="~amd64 ~hppa ~riscv ~sparc"
86 IUSE=""
87
88 +PATCHES=( "${FILESDIR}/${P}-ioctl-test.patch" )
89 +
90 all_ruby_prepare() {
91 echo '-rspec_helper' > .rspec || die
92 sed -i -e 's:require_relative ":require "./:' ${RUBY_FAKEGEM_GEMSPEC} || die