1 |
commit: d12d15fee1604f729ea93a3401cbb25ee41c9897 |
2 |
Author: brahmajit das <listout <AT> protonmail <DOT> com> |
3 |
AuthorDate: Fri Aug 26 19:53:14 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 1 02:06:00 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d12d15fe |
7 |
|
8 |
app-shells/zsh: Fix failing tests on musl |
9 |
|
10 |
On musl the tests A03quoting.ztst, B03print.ztst, V09datetime.ztst, and |
11 |
E02xtrace.ztst were failing. This commit fixes all four (E02xtrace is |
12 |
removed for musl) of them. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/833981 |
15 |
Signed-off-by: brahmajit das <listout <AT> protonmail.com> |
16 |
|
17 |
Signed-off-by: brahmajit das <listout <AT> protonmail.com> |
18 |
Closes: https://github.com/gentoo/gentoo/pull/27019 |
19 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
20 |
|
21 |
.../files/zsh-5.9-musl-V09datetime-test-fix.patch | 15 ++++++++++++++ |
22 |
app-shells/zsh/zsh-5.9.ebuild | 23 +++++++++++++++++++--- |
23 |
2 files changed, 35 insertions(+), 3 deletions(-) |
24 |
|
25 |
diff --git a/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch b/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch |
26 |
new file mode 100644 |
27 |
index 000000000000..6f9fa4458a29 |
28 |
--- /dev/null |
29 |
+++ b/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch |
30 |
@@ -0,0 +1,15 @@ |
31 |
+# On musl strftime '%@' returns new line, so we include to check for that too |
32 |
+# Closes: https://bugs.gentoo.org/833981 |
33 |
+--- a/Test/V09datetime.ztst |
34 |
++++ b/Test/V09datetime.ztst |
35 |
+@@ -79,8 +79,8 @@ |
36 |
+ >1973^@03^@03 |
37 |
+ |
38 |
+ # We assume '%@' is not a valid format on any OSs. |
39 |
+-# The result can be '%@' (Linux), '@' (BSDs) or an error (Cygwin). |
40 |
+- [[ $(strftime '%@' 0 2> /dev/null) == (%|)@ || $? != 0 ]] |
41 |
++# The result can be '%@' (Linux), '\n' (Linux with musl libc) '@', (BSDs) or an error (Cygwin). |
42 |
++ [[ $(strftime '%@' 0 2> /dev/null) == (%|)@ || $? != 0 || $'\n' ]] |
43 |
+ 0:bad format specifier |
44 |
+ |
45 |
+ # This test may fail at 23:59:59.xxx on New Year's Eve :/ |
46 |
|
47 |
diff --git a/app-shells/zsh/zsh-5.9.ebuild b/app-shells/zsh/zsh-5.9.ebuild |
48 |
index a2940a5c435e..9cfcc3a75650 100644 |
49 |
--- a/app-shells/zsh/zsh-5.9.ebuild |
50 |
+++ b/app-shells/zsh/zsh-5.9.ebuild |
51 |
@@ -50,6 +50,13 @@ if [[ ${PV} == *9999 ]] ; then |
52 |
)" |
53 |
fi |
54 |
|
55 |
+PATCHES=( |
56 |
+ # add openrc specific options for init.d completion |
57 |
+ "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff |
58 |
+ # Please refer gentoo bug 833981 |
59 |
+ "${FILESDIR}"/${PN}-5.9-musl-V09datetime-test-fix.patch |
60 |
+) |
61 |
+ |
62 |
src_prepare() { |
63 |
if [[ ${PV} != *9999 ]]; then |
64 |
# fix zshall problem with soelim |
65 |
@@ -58,9 +65,6 @@ src_prepare() { |
66 |
soelim Doc/zshall.1.soelim > Doc/zshall.1 || die |
67 |
fi |
68 |
|
69 |
- # add openrc specific options for init.d completion |
70 |
- eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff |
71 |
- |
72 |
default |
73 |
|
74 |
hprefixify configure.ac |
75 |
@@ -132,6 +136,19 @@ src_compile() { |
76 |
} |
77 |
|
78 |
src_test() { |
79 |
+ # Fixes tests A03quoting.ztst B03print.ztst on musl |
80 |
+ # Please refer: |
81 |
+ # https://www.zsh.org/mla/workers/2021/msg00805.html |
82 |
+ # Test E02xtrace fails on musl, so we are removing it. |
83 |
+ # Closes: https://bugs.gentoo.org/833981 |
84 |
+ if use elibc_musl ; then |
85 |
+ unset LC_ALL |
86 |
+ unset LC_COLLATE |
87 |
+ unset LC_NUMERIC |
88 |
+ unset LC_MESSAGES |
89 |
+ unset LANG |
90 |
+ rm "${S}"/Test/E02xtrace.ztst || die |
91 |
+ fi |
92 |
addpredict /dev/ptmx |
93 |
local i |
94 |
for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do |