Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/PEAR-OLE/, dev-php/PEAR-OLE/files/
Date: Tue, 28 Feb 2017 14:02:36
Message-Id: 1488290527.20b1281c200a0c385f59c5cff8ab2020e299e2d8.grknight@gentoo
1 commit: 20b1281c200a0c385f59c5cff8ab2020e299e2d8
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 14:02:07 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 14:02:07 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20b1281c
7
8 dev-php/PEAR-OLE: Revision bump to include patches from upstream wrt bug 611162
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild | 35 ++++++++
13 .../files/1.0.0_rc2-fix-static-calls.patch | 96 ++++++++++++++++++++++
14 dev-php/PEAR-OLE/files/pear-bug-19284.patch | 24 ++++++
15 3 files changed, 155 insertions(+)
16
17 diff --git a/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild b/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild
18 new file mode 100644
19 index 0000000000..65a1974193
20 --- /dev/null
21 +++ b/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild
22 @@ -0,0 +1,35 @@
23 +# Copyright 1999-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +# $Id$
26 +
27 +EAPI=6
28 +
29 +MY_PN="${PN/PEAR-/}"
30 +MY_PV="${PV/_/}"
31 +MY_PV="${MY_PV^^}"
32 +MY_P="${MY_PN}-${MY_PV}"
33 +
34 +DESCRIPTION="Package for reading and writing OLE containers"
35 +HOMEPAGE="http://pear.php.net/package/${MY_PN}"
36 +SRC_URI="http://download.pear.php.net/package/${MY_P}.tgz"
37 +LICENSE="PHP-3.01"
38 +SLOT="0"
39 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
40 +IUSE=""
41 +
42 +RDEPEND="dev-lang/php:*
43 + dev-php/PEAR-PEAR"
44 +
45 +S="${WORKDIR}/${MY_P}"
46 +
47 +src_prepare() {
48 + eapply "${FILESDIR}/pear-bug-19284.patch" \
49 + "${FILESDIR}/${PV}-fix-static-calls.patch"
50 + eapply_user
51 +}
52 +
53 +src_install() {
54 + insinto /usr/share/php
55 + doins "${MY_PN}.php"
56 + doins -r "${MY_PN}"
57 +}
58
59 diff --git a/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch b/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch
60 new file mode 100644
61 index 0000000000..e9dea0cad4
62 --- /dev/null
63 +++ b/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch
64 @@ -0,0 +1,96 @@
65 +From 17a94ee1f244cbf0c728f37d1628eb28955465ac Mon Sep 17 00:00:00 2001
66 +From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@×××××××××.net>
67 +Date: Mon, 27 Jan 2014 11:32:19 +0100
68 +Subject: [PATCH 1/3] Non-static method System::tmpdir() should not be called
69 + statically, assuming from incompatible context
70 +
71 +---
72 + OLE/PPS/File.php | 3 ++-
73 + OLE/PPS/Root.php | 3 ++-
74 + 2 files changed, 4 insertions(+), 2 deletions(-)
75 +
76 +diff --git a/OLE/PPS/File.php b/OLE/PPS/File.php
77 +index 8fb1acd..553627e 100644
78 +--- a/OLE/PPS/File.php
79 ++++ b/OLE/PPS/File.php
80 +@@ -47,7 +47,8 @@ class OLE_PPS_File extends OLE_PPS
81 + */
82 + function OLE_PPS_File($name)
83 + {
84 +- $this->_tmp_dir = System::tmpdir();
85 ++ $system = new System();
86 ++ $this->_tmp_dir = $system->tmpdir();
87 + $this->OLE_PPS(
88 + null,
89 + $name,
90 +diff --git a/OLE/PPS/Root.php b/OLE/PPS/Root.php
91 +index 387c3b3..9da6330 100755
92 +--- a/OLE/PPS/Root.php
93 ++++ b/OLE/PPS/Root.php
94 +@@ -53,7 +53,8 @@ class OLE_PPS_Root extends OLE_PPS
95 + */
96 + function OLE_PPS_Root($time_1st, $time_2nd, $raChild)
97 + {
98 +- $this->_tmp_dir = System::tmpdir();
99 ++ $system = new System();
100 ++ $this->_tmp_dir = $system->tmpdir();
101 + $this->OLE_PPS(
102 + null,
103 + OLE::Asc2Ucs('Root Entry'),
104 +
105 +From 482239c562cc66959fc8c04e8308d812196d56f8 Mon Sep 17 00:00:00 2001
106 +From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@×××××××××.net>
107 +Date: Mon, 27 Jan 2014 11:35:00 +0100
108 +Subject: [PATCH 2/3] OLE::LocalDate2OLE, OLE::OLE2LocalDate are static
109 + methods.
110 +
111 +These functions are called staticly and don't use $this.
112 +---
113 + OLE.php | 4 ++--
114 + 1 file changed, 2 insertions(+), 2 deletions(-)
115 +
116 +diff --git a/OLE.php b/OLE.php
117 +index d7dced7..2a5da73 100755
118 +--- a/OLE.php
119 ++++ b/OLE.php
120 +@@ -493,7 +493,7 @@ function Asc2Ucs($ascii)
121 + * @param integer $date A timestamp
122 + * @return string The string for the OLE container
123 + */
124 +- function LocalDate2OLE($date = null)
125 ++ static function LocalDate2OLE($date = null)
126 + {
127 + if (!isset($date)) {
128 + return "\x00\x00\x00\x00\x00\x00\x00\x00";
129 +@@ -538,7 +538,7 @@ function LocalDate2OLE($date = null)
130 + * @access public
131 + * @static
132 + */
133 +- function OLE2LocalDate($string)
134 ++ static function OLE2LocalDate($string)
135 + {
136 + if (strlen($string) != 8) {
137 + return new PEAR_Error("Expecting 8 byte string");
138 +
139 +From af1b260a8bd0a5fc337f96f5b84b2accbb75f650 Mon Sep 17 00:00:00 2001
140 +From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@×××××××××.net>
141 +Date: Mon, 27 Jan 2014 11:38:34 +0100
142 +Subject: [PATCH 3/3] Asc2Ucs is a static method.
143 +
144 +---
145 + OLE.php | 2 +-
146 + 1 file changed, 1 insertion(+), 1 deletion(-)
147 +
148 +diff --git a/OLE.php b/OLE.php
149 +index 2a5da73..e0cec8f 100755
150 +--- a/OLE.php
151 ++++ b/OLE.php
152 +@@ -475,7 +475,7 @@ function getDataLength($index)
153 + * @param string $ascii The ASCII string to transform
154 + * @return string The string in Unicode
155 + */
156 +- function Asc2Ucs($ascii)
157 ++ static function Asc2Ucs($ascii)
158 + {
159 + $rawname = '';
160 + for ($i = 0; $i < strlen($ascii); $i++) {
161
162 diff --git a/dev-php/PEAR-OLE/files/pear-bug-19284.patch b/dev-php/PEAR-OLE/files/pear-bug-19284.patch
163 new file mode 100644
164 index 0000000000..c94142c1ae
165 --- /dev/null
166 +++ b/dev-php/PEAR-OLE/files/pear-bug-19284.patch
167 @@ -0,0 +1,24 @@
168 +From e63587ddb88057cc2e403c48d2f41728ba1044ef Mon Sep 17 00:00:00 2001
169 +From: flack <flack@×××××××××××××××××××××.de>
170 +Date: Tue, 27 Nov 2012 10:26:09 +0100
171 +Subject: [PATCH] Fix problem where Excel files couldn't be opened in Ofccie
172 + 2010
173 +
174 +I haven't traced the problem, the fix is from one of the comments of http://pear.php.net/bugs/bug.php?id=19284, but for me, this reproducably fixes the issue the Excel 2010 refuses to open the files because they are corrupt
175 +---
176 + OLE/PPS/Root.php | 2 +-
177 + 1 file changed, 1 insertion(+), 1 deletion(-)
178 +
179 +diff --git a/OLE/PPS/Root.php b/OLE/PPS/Root.php
180 +index 2f19ba0..387c3b3 100755
181 +--- a/OLE/PPS/Root.php
182 ++++ b/OLE/PPS/Root.php
183 +@@ -620,7 +620,7 @@ function _create_header($num_sb_blocks, $num_bb_blocks, $num_pps_blocks)
184 + else
185 + fwrite($FILE, pack("V", -2));
186 +
187 +- fwrite($FILE, pack("V", 1));
188 ++ fwrite($FILE, pack("V", $num_sb_blocks));
189 +
190 + // Extra BDList Start, Count
191 + if($bbd_info["blockchain_list_entries"] < $bbd_info["header_blockchain_list_entries"])