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/pecl-ssh2/, dev-php/pecl-ssh2/files/
Date: Thu, 23 Sep 2021 14:44:36
Message-Id: 1632408084.41c7e35cc617c5b79089ab4af123f2b5bac1f1b2.grknight@gentoo
1 commit: 41c7e35cc617c5b79089ab4af123f2b5bac1f1b2
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 23 14:41:24 2021 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 23 14:41:24 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41c7e35c
7
8 dev-php/pecl-ssh2: Drop old
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 dev-php/pecl-ssh2/Manifest | 3 -
13 ...1.1.2-fix-php_url-fields-usage-for-php7-3.patch | 302 ---------------------
14 dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild | 36 ---
15 dev-php/pecl-ssh2/pecl-ssh2-1.2.ebuild | 33 ---
16 4 files changed, 374 deletions(-)
17
18 diff --git a/dev-php/pecl-ssh2/Manifest b/dev-php/pecl-ssh2/Manifest
19 index 4a420e281de..0d800ebf183 100644
20 --- a/dev-php/pecl-ssh2/Manifest
21 +++ b/dev-php/pecl-ssh2/Manifest
22 @@ -1,4 +1 @@
23 -DIST pecl-ssh2-1.1.2-fix-php7-port.patch 27860 BLAKE2B 23054187608bdcf79f53ce638e37c646f44297aa7d1e8f7a7c85fd922977ab835b915d541fbae327a30d2e863b503ed4822a82c1b242346290ceb94d49c97020 SHA512 1c2ecc990323a77fb2b69be0d6649f96dd7ad2d06c62f4fcb79a9ef4f89e066d463301668a044d37d717c99837c5d7d3f621f61119543445bd05c3229d9270e9
24 -DIST pecl-ssh2-1.2.tar.gz 32447 BLAKE2B 3a9d0f205097a381d07fb9dd5ab4dcb8e361f555dbc633abb8fa895c83024b70e85cd87602da1ceeb1018a7b07c474720b02810ef0689e9294fc33b129b6c738 SHA512 7b7d311cd5f88835e124d70a0295468f75d0fa6936a58808c936d1a185bb630b9e02c21f49b4bd777194a7b104aa3ff85c4fbf480f43d5906787e532ba2d3e04
25 -DIST ssh2-1.1.2.tgz 32057 BLAKE2B 88ffb3fb608687a086bbe345677982e944210791acc100312ba56ac7c35188a52cde5529d78caf473d19710e9965fba853ea9ff046715413a0b488ae2d8b690c SHA512 36793191448745b8a9b3cc628fe9fb431480792c7a2ff0bf2eccd58cda1cf944933be1d301c455d4a6f3dabf7e04ffef248bc402a8ff99bfafcba0deddb25c36
26 DIST ssh2-1.3.1.tgz 33838 BLAKE2B 05976ad143563fd9d51be3f8e23b5b22099e351d6f252b612aa1dcb56648dc337b623d2cddf7b9079f3e07c879ca69215a1987cd6f4326f97ba134e13c6d28e7 SHA512 c74d4f699853148b53cdca0eaf8837bfdbdd21d185761606acadf2442e84dbefdb00cde207e0ce4794ae1e4f8692a38ed903b6d11fdc57bca7b54a4250da9a76
27
28 diff --git a/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch b/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch
29 deleted file mode 100644
30 index 1f135256422..00000000000
31 --- a/dev-php/pecl-ssh2/files/pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch
32 +++ /dev/null
33 @@ -1,302 +0,0 @@
34 -From a8835aab2c15e794fce13bd927295719e384ad2d Mon Sep 17 00:00:00 2001
35 -From: Remi Collet <remi@×××.net>
36 -Date: Thu, 28 Jun 2018 07:10:35 +0200
37 -Subject: [PATCH] fix php_url fields usage for PHP 7.3
38 -
39 ----
40 - php_ssh2.h | 8 ++++++++
41 - ssh2_fopen_wrappers.c | 55 ++++++++++++++++++++++++++++++++-------------------
42 - ssh2_sftp.c | 20 +++++++++----------
43 - 3 files changed, 53 insertions(+), 30 deletions(-)
44 -
45 -diff --git a/php_ssh2.h b/php_ssh2.h
46 -index 734b795..d010ff9 100644
47 ---- a/php_ssh2.h
48 -+++ b/php_ssh2.h
49 -@@ -166,6 +166,14 @@ extern php_stream_wrapper php_ssh2_sftp_wrapper;
50 - extern int le_ssh2_session;
51 - extern int le_ssh2_sftp;
52 -
53 -+#if PHP_VERSION_ID < 70300
54 -+#define SSH2_URL_STR(a) (a)
55 -+#define SSH2_URL_LEN(a) strlen(a)
56 -+#else
57 -+#define SSH2_URL_STR(a) ZSTR_VAL(a)
58 -+#define SSH2_URL_LEN(a) ZSTR_LEN(a)
59 -+#endif
60 -+
61 - #endif /* PHP_SSH2_H */
62 -
63 - /*
64 -diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c
65 -index 2f96ca4..f2f3475 100644
66 ---- a/ssh2_fopen_wrappers.c
67 -+++ b/ssh2_fopen_wrappers.c
68 -@@ -215,7 +215,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
69 - php_url *resource;
70 - zval *methods = NULL, *callbacks = NULL, zsession, *tmpzval;
71 - zend_long resource_id;
72 -- char *h, *s, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
73 -+ char *h, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
74 - int username_len = 0, password_len = 0;
75 -
76 - h = strstr(path, "Resource id #");
77 -@@ -233,13 +233,13 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
78 - return NULL;
79 - }
80 -
81 -- if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {
82 -+ if (strncmp(SSH2_URL_STR(resource->scheme), "ssh2.", sizeof("ssh2.") - 1)) {
83 - /* Not an ssh wrapper */
84 - php_url_free(resource);
85 - return NULL;
86 - }
87 -
88 -- if (strcmp(resource->scheme + sizeof("ssh2.") - 1, type)) {
89 -+ if (strcmp(SSH2_URL_STR(resource->scheme) + sizeof("ssh2.") - 1, type)) {
90 - /* Wrong ssh2. wrapper type */
91 - php_url_free(resource);
92 - return NULL;
93 -@@ -253,13 +253,27 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
94 - Find resource->path in the path string, then copy the entire string from the original path.
95 - This includes ?query#fragment in the path string
96 - */
97 -+// TODO copy seems uneeded
98 -+#if PHP_VERSION_ID < 70300
99 -+ {
100 -+ char * s;
101 -+
102 - s = resource->path;
103 - resource->path = estrdup(strstr(path, resource->path));
104 - efree(s);
105 -+ }
106 -+#else
107 -+ {
108 -+ zend_string *tmp;
109 -+
110 -+ tmp = resource->path;
111 -+ resource->path = zend_string_init(ZSTR_VAL(resource->path), ZSTR_LEN(resource->path), 0);
112 -+ zend_string_release(tmp);
113 -+ }
114 -+#endif
115 -
116 - /* Look for a resource ID to reuse a session */
117 -- s = resource->host;
118 -- if (is_numeric_string(s, strlen(s), &resource_id, NULL, 0) == IS_LONG) {
119 -+ if (is_numeric_string(SSH2_URL_STR(resource->host), SSH2_URL_LEN(resource->host), &resource_id, NULL, 0) == IS_LONG) {
120 - php_ssh2_sftp_data *sftp_data;
121 - zval *zresource;
122 -
123 -@@ -309,7 +323,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
124 - }
125 -
126 - /* Fallback on finding it in the context */
127 -- if (resource->host[0] == 0 && context && psftp &&
128 -+ if (SSH2_URL_STR(resource->host)[0] == 0 && context && psftp &&
129 - (tmpzval = php_stream_context_get_option(context, "ssh2", "sftp")) != NULL &&
130 - Z_TYPE_P(tmpzval) == IS_RESOURCE) {
131 - php_ssh2_sftp_data *sftp_data;
132 -@@ -323,7 +337,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
133 - return resource;
134 - }
135 - }
136 -- if (resource->host[0] == 0 && context &&
137 -+ if (SSH2_URL_STR(resource->host)[0] == 0 && context &&
138 - (tmpzval = php_stream_context_get_option(context, "ssh2", "session")) != NULL &&
139 - Z_TYPE_P(tmpzval) == IS_RESOURCE) {
140 - session = (LIBSSH2_SESSION *)zend_fetch_resource(Z_RES_P(tmpzval), PHP_SSH2_SESSION_RES_NAME, le_ssh2_session);
141 -@@ -399,19 +413,19 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
142 - }
143 -
144 - if (resource->user) {
145 -- int len = strlen(resource->user);
146 -+ int len = SSH2_URL_LEN(resource->user);
147 -
148 - if (len) {
149 -- username = resource->user;
150 -+ username = SSH2_URL_STR(resource->user);
151 - username_len = len;
152 - }
153 - }
154 -
155 - if (resource->pass) {
156 -- int len = strlen(resource->pass);
157 -+ int len = SSH2_URL_LEN(resource->pass);
158 -
159 - if (len) {
160 -- password = resource->pass;
161 -+ password = SSH2_URL_STR(resource->pass);
162 - password_len = len;
163 - }
164 - }
165 -@@ -422,7 +436,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
166 - return NULL;
167 - }
168 -
169 -- session = php_ssh2_session_connect(resource->host, resource->port, methods, callbacks);
170 -+ session = php_ssh2_session_connect(SSH2_URL_STR(resource->host), resource->port, methods, callbacks);
171 - if (!session) {
172 - /* Unable to connect! */
173 - php_url_free(resource);
174 -@@ -482,6 +496,7 @@ session_authed:
175 - *psftp = sftp;
176 - }
177 -
178 -+ //TODO may be undefined
179 - *presource_id = Z_LVAL(zsession);
180 - *psession = session;
181 -
182 -@@ -527,7 +542,7 @@ static php_stream *php_ssh2_shell_open(LIBSSH2_SESSION *session, int resource_id
183 - zval_copy_ctor(&copyval);
184 - convert_to_string(&copyval);
185 - if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) {
186 -- php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
187 -+ php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval));
188 - }
189 - zval_dtor(&copyval);
190 - }
191 -@@ -631,7 +646,7 @@ static php_stream *php_ssh2_fopen_wrapper_shell(php_stream_wrapper *wrapper, con
192 - zval_ptr_dtor(&copyval);
193 - }
194 -
195 -- s = resource->path ? resource->path : NULL;
196 -+ s = resource->path ? SSH2_URL_STR(resource->path) : NULL;
197 -
198 - if (s && s[0] == '/') {
199 - /* Terminal type encoded into URL overrides context terminal type */
200 -@@ -766,7 +781,7 @@ static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, int resource_
201 - zval_copy_ctor(&copyval);
202 - convert_to_string(&copyval);
203 - if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) {
204 -- php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
205 -+ php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval));
206 - }
207 - zval_dtor(&copyval);
208 - }
209 -@@ -878,7 +893,7 @@ static php_stream *php_ssh2_fopen_wrapper_exec(php_stream_wrapper *wrapper, cons
210 - zval_ptr_dtor(copyval);
211 - }
212 -
213 -- stream = php_ssh2_exec_command(session, resource_id, resource->path + 1, terminal, terminal_len, environment, width, height, type);
214 -+ stream = php_ssh2_exec_command(session, resource_id, SSH2_URL_STR(resource->path) + 1, terminal, terminal_len, environment, width, height, type);
215 - if (!stream) {
216 - // TODO Sean-Der
217 - //zend_list_delete(resource_id);
218 -@@ -1021,7 +1036,7 @@ static php_stream *php_ssh2_fopen_wrapper_scp(php_stream_wrapper *wrapper, const
219 - return NULL;
220 - }
221 -
222 -- stream = php_ssh2_scp_xfer(session, resource_id, resource->path);
223 -+ stream = php_ssh2_scp_xfer(session, resource_id, SSH2_URL_STR(resource->path));
224 - if (!stream) {
225 - //TODO Sean-Der
226 - //zend_list_delete(resource_id);
227 -@@ -1147,7 +1162,7 @@ PHP_FUNCTION(ssh2_scp_send)
228 - char *error_msg = NULL;
229 -
230 - last_error = libssh2_session_last_error(session, &error_msg, NULL, 0);
231 -- php_error_docref(NULL, E_WARNING, "Failure creating remote file: %s", error_msg);
232 -+ php_error_docref(NULL, E_WARNING, "Failure creating remote file: %s (%d)", error_msg, last_error);
233 - php_stream_close(local_file);
234 - RETURN_FALSE;
235 - }
236 -@@ -1262,10 +1277,10 @@ static php_stream *php_ssh2_fopen_wrapper_tunnel(php_stream_wrapper *wrapper, co
237 - return NULL;
238 - }
239 -
240 -- if (resource->path && resource->path[0] == '/') {
241 -+ if (resource->path && SSH2_URL_STR(resource->path)[0] == '/') {
242 - char *colon;
243 -
244 -- host = resource->path + 1;
245 -+ host = SSH2_URL_STR(resource->path) + 1;
246 - if (*host == '[') {
247 - /* IPv6 Encapsulated Format */
248 - host++;
249 -diff --git a/ssh2_sftp.c b/ssh2_sftp.c
250 -index 13f89f0..6332be8 100644
251 ---- a/ssh2_sftp.c
252 -+++ b/ssh2_sftp.c
253 -@@ -238,7 +238,7 @@ static php_stream *php_ssh2_sftp_stream_opener(php_stream_wrapper *wrapper, cons
254 -
255 - flags = php_ssh2_parse_fopen_modes((char *)mode);
256 -
257 -- handle = libssh2_sftp_open(sftp, resource->path, flags, perms);
258 -+ handle = libssh2_sftp_open(sftp, SSH2_URL_STR(resource->path), flags, perms);
259 - if (!handle) {
260 - php_error_docref(NULL, E_WARNING, "Unable to open %s on remote host", filename);
261 - php_url_free(resource);
262 -@@ -341,7 +341,7 @@ static php_stream *php_ssh2_sftp_dirstream_opener(php_stream_wrapper *wrapper, c
263 - return NULL;
264 - }
265 -
266 -- handle = libssh2_sftp_opendir(sftp, resource->path);
267 -+ handle = libssh2_sftp_opendir(sftp, SSH2_URL_STR(resource->path));
268 - if (!handle) {
269 - php_error_docref(NULL, E_WARNING, "Unable to open %s on remote host", filename);
270 - php_url_free(resource);
271 -@@ -386,7 +386,7 @@ static int php_ssh2_sftp_urlstat(php_stream_wrapper *wrapper, const char *url, i
272 - return -1;
273 - }
274 -
275 -- if (libssh2_sftp_stat_ex(sftp, resource->path, strlen(resource->path),
276 -+ if (libssh2_sftp_stat_ex(sftp, SSH2_URL_STR(resource->path), SSH2_URL_LEN(resource->path),
277 - (flags & PHP_STREAM_URL_STAT_LINK) ? LIBSSH2_SFTP_LSTAT : LIBSSH2_SFTP_STAT, &attrs)) {
278 - php_url_free(resource);
279 - //zend_list_delete(sftp_rsrcid);
280 -@@ -420,7 +420,7 @@ static int php_ssh2_sftp_unlink(php_stream_wrapper *wrapper, const char *url, in
281 - return 0;
282 - }
283 -
284 -- result = libssh2_sftp_unlink(sftp, resource->path);
285 -+ result = libssh2_sftp_unlink(sftp, SSH2_URL_STR(resource->path));
286 - php_url_free(resource);
287 -
288 - //zend_list_delete(sftp_rsrcid);
289 -@@ -462,7 +462,7 @@ static int php_ssh2_sftp_rename(php_stream_wrapper *wrapper, const char *url_fro
290 - return 0;
291 - }
292 -
293 -- result = libssh2_sftp_rename(sftp, resource->path, resource_to->path);
294 -+ result = libssh2_sftp_rename(sftp, SSH2_URL_STR(resource->path), SSH2_URL_STR(resource_to->path));
295 - php_url_free(resource);
296 - php_url_free(resource_to);
297 -
298 -@@ -493,13 +493,13 @@ static int php_ssh2_sftp_mkdir(php_stream_wrapper *wrapper, const char *url, int
299 -
300 - if (options & PHP_STREAM_MKDIR_RECURSIVE) {
301 - /* Just attempt to make every directory, some will fail, but we only care about the last success/failure */
302 -- char *p = resource->path;
303 -+ char *p = SSH2_URL_STR(resource->path);
304 - while ((p = strchr(p + 1, '/'))) {
305 -- libssh2_sftp_mkdir_ex(sftp, resource->path, p - resource->path, mode);
306 -+ libssh2_sftp_mkdir_ex(sftp, SSH2_URL_STR(resource->path), p - SSH2_URL_STR(resource->path), mode);
307 - }
308 - }
309 -
310 -- result = libssh2_sftp_mkdir(sftp, resource->path, mode);
311 -+ result = libssh2_sftp_mkdir(sftp, SSH2_URL_STR(resource->path), mode);
312 - php_url_free(resource);
313 -
314 - //zend_list_delete(sftp_rsrcid);
315 -@@ -527,7 +527,7 @@ static int php_ssh2_sftp_rmdir(php_stream_wrapper *wrapper, const char *url, int
316 - return 0;
317 - }
318 -
319 -- result = libssh2_sftp_rmdir(sftp, resource->path);
320 -+ result = libssh2_sftp_rmdir(sftp, SSH2_URL_STR(resource->path));
321 - php_url_free(resource);
322 -
323 - //zend_list_delete(sftp_rsrcid);
324 -@@ -836,7 +836,7 @@ PHP_FUNCTION(ssh2_sftp_readlink)
325 - }
326 -
327 - if ((targ_len = libssh2_sftp_symlink_ex(data->sftp, link->val, link->len, targ, 8192, LIBSSH2_SFTP_READLINK)) < 0) {
328 -- php_error_docref(NULL, E_WARNING, "Unable to read link '%s'", link);
329 -+ php_error_docref(NULL, E_WARNING, "Unable to read link '%s'", ZSTR_VAL(link));
330 - RETURN_FALSE;
331 - }
332 -
333 ---
334 -2.1.4
335 -
336
337 diff --git a/dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild b/dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild
338 deleted file mode 100644
339 index a27f6970b15..00000000000
340 --- a/dev-php/pecl-ssh2/pecl-ssh2-1.1.2.ebuild
341 +++ /dev/null
342 @@ -1,36 +0,0 @@
343 -# Copyright 1999-2020 Gentoo Authors
344 -# Distributed under the terms of the GNU General Public License v2
345 -
346 -EAPI="7"
347 -
348 -PHP_EXT_NAME="ssh2"
349 -
350 -USE_PHP="php5-6 php7-1 php7-2 php7-3"
351 -
352 -inherit php-ext-pecl-r3
353 -
354 -USE_PHP="php7-1 php7-2 php7-3"
355 -
356 -DESCRIPTION="PHP bindings for the libssh2 library"
357 -LICENSE="PHP-3.01"
358 -SLOT="7"
359 -
360 -SRC_URI+=" https://dev.gentoo.org/~juippis/distfiles/tmp/pecl-ssh2-1.1.2-fix-php7-port.patch"
361 -KEYWORDS="amd64 x86"
362 -# Upstream notes say there are errors with gcrypt backend
363 -DEPEND=">=net-libs/libssh2-1.2[-gcrypt]"
364 -RDEPEND="${DEPEND}
365 - php_targets_php5-6? ( dev-php/pecl-ssh2:0[php_targets_php5-6] )"
366 -
367 -PATCHES=(
368 - "${FILESDIR}"/${P}-fix-php_url-fields-usage-for-php7-3.patch
369 - "${DISTDIR}"/${P}-fix-php7-port.patch
370 -)
371 -
372 -src_prepare() {
373 - if use php_targets_php7-1 || use php_targets_php7-2 || use php_targets_php7-3; then
374 - php-ext-source-r3_src_prepare
375 - else
376 - default_src_prepare
377 - fi
378 -}
379
380 diff --git a/dev-php/pecl-ssh2/pecl-ssh2-1.2.ebuild b/dev-php/pecl-ssh2/pecl-ssh2-1.2.ebuild
381 deleted file mode 100644
382 index ffc132c9374..00000000000
383 --- a/dev-php/pecl-ssh2/pecl-ssh2-1.2.ebuild
384 +++ /dev/null
385 @@ -1,33 +0,0 @@
386 -# Copyright 1999-2019 Gentoo Authors
387 -# Distributed under the terms of the GNU General Public License v2
388 -
389 -EAPI="7"
390 -
391 -PHP_EXT_NAME="ssh2"
392 -
393 -USE_PHP="php5-6 php7-1 php7-2 php7-3 php7-4"
394 -
395 -inherit php-ext-pecl-r3
396 -
397 -# https://pecl.php.net/get/ssh2-1.2.tgz isn't work for some weeks
398 -SRC_URI="https://dev.gentoo.org/~whissi/dist/${PN}/${P}.tar.gz"
399 -
400 -USE_PHP="php7-1 php7-2 php7-3 php7-4"
401 -
402 -DESCRIPTION="PHP bindings for the libssh2 library"
403 -LICENSE="PHP-3.01"
404 -SLOT="7"
405 -IUSE=""
406 -KEYWORDS="~amd64 ~x86"
407 -# Upstream notes say there are errors with gcrypt backend
408 -DEPEND=">=net-libs/libssh2-1.2[-gcrypt]"
409 -RDEPEND="${DEPEND}
410 - php_targets_php5-6? ( dev-php/pecl-ssh2:0[php_targets_php5-6] )"
411 -
412 -src_prepare() {
413 - if use php_targets_php7-1 || use php_targets_php7-2 || use php_targets_php7-3 || use php_targets_php7-4 ; then
414 - php-ext-source-r3_src_prepare
415 - else
416 - default_src_prepare
417 - fi
418 -}