1 |
commit: 7a0bdecc24d03a76129348278503ca00d617322a |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 21 21:50:15 2017 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 21 21:50:15 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a0bdecc |
7 |
|
8 |
dev-perl/DBD-mysql: -r1 bump for fix for type conversions for amvisd |
9 |
|
10 |
Earlier versions break type conversions that amvisd uses, and though |
11 |
the fix for this landed in 4.42.0, 4.42.0 also introduced a more serious |
12 |
change that breaks existing code, and the entire thing was reverted |
13 |
for 4.43.0 |
14 |
|
15 |
So this is borrowing debians patch for 4.41.0 |
16 |
|
17 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
18 |
|
19 |
dev-perl/DBD-mysql/DBD-mysql-4.41.0-r1.ebuild | 68 ++++++++++++++++++++++ |
20 |
.../files/4.041-amvis-type-conversions.patch | 47 +++++++++++++++ |
21 |
2 files changed, 115 insertions(+) |
22 |
|
23 |
diff --git a/dev-perl/DBD-mysql/DBD-mysql-4.41.0-r1.ebuild b/dev-perl/DBD-mysql/DBD-mysql-4.41.0-r1.ebuild |
24 |
new file mode 100644 |
25 |
index 00000000000..1c899123f57 |
26 |
--- /dev/null |
27 |
+++ b/dev-perl/DBD-mysql/DBD-mysql-4.41.0-r1.ebuild |
28 |
@@ -0,0 +1,68 @@ |
29 |
+# Copyright 1999-2017 Gentoo Foundation |
30 |
+# Distributed under the terms of the GNU General Public License v2 |
31 |
+ |
32 |
+EAPI=6 |
33 |
+ |
34 |
+DIST_AUTHOR=MICHIELB |
35 |
+DIST_VERSION=4.041 |
36 |
+inherit eutils perl-module |
37 |
+ |
38 |
+DESCRIPTION="MySQL driver for the Perl5 Database Interface (DBI)" |
39 |
+ |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
42 |
+ |
43 |
+# embedded=on disables ssl support |
44 |
+# https://metacpan.org/source/MICHIELB/DBD-mysql-4.036/dbdimp.c#L1886 |
45 |
+REQUIRED_USE="?? ( embedded ssl )" |
46 |
+IUSE="embedded test +ssl" |
47 |
+ |
48 |
+RDEPEND=">=dev-perl/DBI-1.609.0 |
49 |
+ virtual/libmysqlclient:= |
50 |
+ embedded? ( virtual/mysql[embedded] ) |
51 |
+" |
52 |
+DEPEND="${RDEPEND} |
53 |
+ virtual/perl-ExtUtils-MakeMaker |
54 |
+ virtual/perl-Data-Dumper |
55 |
+ test? ( |
56 |
+ dev-perl/Test-Deep |
57 |
+ >=virtual/perl-Test-Simple-0.900.0 |
58 |
+ virtual/perl-Time-HiRes |
59 |
+ ) |
60 |
+" |
61 |
+PATCHES=( |
62 |
+ "${FILESDIR}/${DIST_VERSION}-no-dot-inc.patch" |
63 |
+ "${FILESDIR}/${DIST_VERSION}-amvis-type-conversions.patch" |
64 |
+) |
65 |
+src_configure() { |
66 |
+ if use test; then |
67 |
+ myconf="${myconf} --testdb=test \ |
68 |
+ --testhost=localhost \ |
69 |
+ --testuser=test \ |
70 |
+ --testpassword=test" |
71 |
+ fi |
72 |
+ myconf="${myconf} --$(usex ssl ssl nossl)" |
73 |
+ use embedded && myconf="${myconf} --force-embedded --embedded=mysql_config" |
74 |
+ perl-module_src_configure |
75 |
+} |
76 |
+ |
77 |
+# Parallel testing is broken as 2 tests create the same table |
78 |
+# and mysql isn't acid compliant and can't limit visibility of tables |
79 |
+# to a transaction... |
80 |
+DIST_TEST="do" |
81 |
+ |
82 |
+src_test() { |
83 |
+ einfo |
84 |
+ einfo "If tests fail, you have to configure your MySQL instance to create" |
85 |
+ einfo "and grant some privileges to the test user." |
86 |
+ einfo "You can run the following commands at the MySQL prompt: " |
87 |
+ einfo "> CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';" |
88 |
+ einfo "> CREATE DATABASE test;" |
89 |
+ einfo "> GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost';" |
90 |
+ einfo |
91 |
+ sleep 5 |
92 |
+ perl_rm_files t/pod.t t/manifest.t |
93 |
+ # Don't be a hero and try to do EXTENDED_TESTING=1 unless you can figure |
94 |
+ # out why 60leaks.t fails |
95 |
+ perl-module_src_test |
96 |
+} |
97 |
|
98 |
diff --git a/dev-perl/DBD-mysql/files/4.041-amvis-type-conversions.patch b/dev-perl/DBD-mysql/files/4.041-amvis-type-conversions.patch |
99 |
new file mode 100644 |
100 |
index 00000000000..041ba0a496a |
101 |
--- /dev/null |
102 |
+++ b/dev-perl/DBD-mysql/files/4.041-amvis-type-conversions.patch |
103 |
@@ -0,0 +1,47 @@ |
104 |
+From: Pali <pali@××××.org> |
105 |
+Date: Fri, 24 Feb 2017 19:51:36 +0100 |
106 |
+Subject: [PATCH] Fix type conversions |
107 |
+ |
108 |
+Calling SvNV() for magical scalar is not enough for float type conversion. |
109 |
+It caused problem for Amavis in tainted mode -- all float values were zero. |
110 |
+On the other hand SvIV() and SvUV() seems to work fine. To be sure that |
111 |
+correct value of float is in scalar use sv_setnv() with explicit NV float |
112 |
+value. Similar code is changed also for integers IV/UV. |
113 |
+ |
114 |
+This patch should fix reported Amavis bug: |
115 |
+https://github.com/perl5-dbi/DBD-mysql/issues/78 |
116 |
+ |
117 |
+See also reported perl bug about SvNV(): |
118 |
+https://rt.perl.org/Public/Bug/Display.html?id=130801 |
119 |
+ |
120 |
+Bugs: https://github.com/perl5-dbi/DBD-mysql/issues/78 |
121 |
+Bugs-Debian: https://bugs.debian.org/856064 |
122 |
+ |
123 |
+--- a/dbdimp.c |
124 |
++++ b/dbdimp.c |
125 |
+@@ -4250,8 +4250,7 @@ |
126 |
+ switch (mysql_to_perl_type(fields[i].type)) { |
127 |
+ case MYSQL_TYPE_DOUBLE: |
128 |
+ /* Coerce to dobule and set scalar as NV */ |
129 |
+- (void) SvNV(sv); |
130 |
+- SvNOK_only(sv); |
131 |
++ sv_setnv(sv, SvNV(sv)); |
132 |
+ break; |
133 |
+ |
134 |
+ case MYSQL_TYPE_LONG: |
135 |
+@@ -4259,13 +4258,11 @@ |
136 |
+ /* Coerce to integer and set scalar as UV resp. IV */ |
137 |
+ if (fields[i].flags & UNSIGNED_FLAG) |
138 |
+ { |
139 |
+- (void) SvUV(sv); |
140 |
+- SvIOK_only_UV(sv); |
141 |
++ sv_setuv(sv, SvUV(sv)); |
142 |
+ } |
143 |
+ else |
144 |
+ { |
145 |
+- (void) SvIV(sv); |
146 |
+- SvIOK_only(sv); |
147 |
++ sv_setiv(sv, SvIV(sv)); |
148 |
+ } |
149 |
+ break; |
150 |
+ |