added dev-php/pecl-ast, dev-php/pecl-ssh2 with "PHP7.2" use-flag.

This commit is contained in:
Micha Glave 2021-05-06 10:30:24 +02:00
parent dfdd3c3edd
commit 423e5d292e
8 changed files with 354 additions and 27 deletions

View File

@ -1,2 +0,0 @@
DIST vimrc-1.1.tar.gz 6791311 SHA256 54b7366969544c5b0b5a05993b78a253090daa621ab7e31e2be366641b425f39 SHA512 556953a652b65d723feb477c2c519d8f6f3fc406f9b2ba055f0c96caa4cbe9d8db989c36f7457a3787ad11d545bee7a77ee8bcb8999ae568aaf11f57e6ab091f WHIRLPOOL ea945ffee72a3a61be022dbf9cdfddf2837183f5e27718fed5ec22958f127d4788d9d6a83e3e6b976e1d7eb950f95c93332134a28849b8cbe4a7ba63624ec5d3
EBUILD drupal-syntax-1.1.ebuild 659 SHA256 93077ea2cef1c12eaad7ada834db656669ef637d3c9becfef867f7c087db23c9 SHA512 6e59f783447aa6f4e58e685e6a1a0f23f0e9898ad4ff9be4640c33b515ed8a38d6955d2d878cc455c254c65f22de905b81ca396b92e605b4af1392ee63fe8b2f WHIRLPOOL 672d6c9666fb5cc601cd486101c2d2a8c8d3e32eb6339fc221496ed6993e69fb176313c4c5a5fc3c29be8934ed6b1bcc080db631bf5ebd2e6952ae76733401c1

View File

@ -1,25 +0,0 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="4"
VIM_PLUGIN_VIM_VERSION="7.0"
inherit vim-plugin
# 4 Jan 2015
GIT_TAG="a1d6e30f71056c2333cd98b3404aaff5724c6638"
DESCRIPTION="vim plugin: drupal-module-php syntax"
HOMEPAGE="http://drupal.org/project/vimrc"
SRC_URI="http://cgit.drupalcode.org/vimrc/snapshot/${GIT_TAG}.tar.gz -> vimrc-${PV}.tar.gz"
LICENSE="as-is"
KEYWORDS="ppc x86 amd64"
IUSE=""
VIM_PLUGIN_HELPTEXT="Vim Syntax highlight for drupal files."
VIM_PLUGIN_HELPURI=""
VIM_PLUGIN_HELPFILES="drupal"
VIM_PLUGIN_MESSAGES="filetype"
S="${WORKDIR}/${GIT_TAG}"

View File

@ -0,0 +1,2 @@
DIST ast-1.0.11.tgz 48232 BLAKE2B 601da18be5f0607633ba3744020160ddd1b822ee5cb919467f887a3d9fb6f3bee039e8ae78b9650836c341f231631f8cdd9a46670b414ec75189c7783628524e SHA512 54e28bfdbe72e4a7675c2a6d6e50560bc55c8aa5b102a0469f3baafee35b039aca0d8ce70dd1fcb14d956003ee5a071b19388d303711d5d0aef7b3039bee2d3c
EBUILD pecl-ast-1.0.11.ebuild 368 BLAKE2B aeeaea227120b5854a4ef540ffb982a49ec9a4e2b511f10737fd5c19ec44a3ff4d2363f966d6ad7ecaf10027b54cc312806a46d3563094901ea63c7da1d10967 SHA512 de66b86d1464e438031efcb79d0335c8c82c8b9fc05594b7f6ac8970680b7bfb2e735bebfeda533abd13c7cd70a4128f7dcabc35b2be6083d59b6f970031b4d1

View File

@ -0,0 +1,19 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PHP_EXT_NAME="ast"
PHP_EXT_PECL_PKG="ast"
PHP_EXT_INI="yes"
PHP_EXT_ZENDEXT="no"
USE_PHP="php7-3 php7-4 php8-0"
inherit php-ext-pecl-r3
KEYWORDS="~amd64 ~x86"
DESCRIPTION="Extension exposing PHP 7 abstract syntax tree"
LICENSE="PHP-3"
SLOT="0"
IUSE=""

View File

@ -0,0 +1,4 @@
AUX pecl-ssh2-1.1.2-fix-php_url-fields-usage-for-php7-3.patch 11461 BLAKE2B 62b07aa1c70c14ed3a1bebb633c47a39f39be120df29ad85e6abacd276fef214cfd85ec07d8504b51c423cc7971fe4eb293e9fb6c8423a3505323f6535a01655 SHA512 86f460c280a83718e195bb255ef686a3632e98ab598ebcb7fa05b5e5727800729c91de9efd60dc19884f015c06d0a7675beecc296d259f493b2f697aaf143e34
DIST ssh2-1.3.1.tgz 33838 BLAKE2B 05976ad143563fd9d51be3f8e23b5b22099e351d6f252b612aa1dcb56648dc337b623d2cddf7b9079f3e07c879ca69215a1987cd6f4326f97ba134e13c6d28e7 SHA512 c74d4f699853148b53cdca0eaf8837bfdbdd21d185761606acadf2442e84dbefdb00cde207e0ce4794ae1e4f8692a38ed903b6d11fdc57bca7b54a4250da9a76
EBUILD pecl-ssh2-1.3.1-r1.ebuild 429 BLAKE2B cfbb3ed9ba9d0dddabea556323a302408b7476eef9b0408faf05f31bfc7aed56505c7f977c3ac242809130a9f4947693842ab69b4e4b835d31cbb3c366dfe795 SHA512 30da9e406f2eee25fb859558e52c23af50057cdb0d497f35b5e33746a2055d11ccb09610021f8a3d1a6e0da15fdf63c56888a98585b92522a1cdaf26eb5b7610
MISC metadata.xml 235 BLAKE2B 5b10304feea18aae1822be7d29bcce06c8715193b14a3dd2c4d79eb75e2767670352e2ca11e06b9a10ec04b63020a18254cd167e6d6be9072f4a200ca5d11ec4 SHA512 0b3e95bbf68eddf74289dad50f8828cffce2d904ff6f9bd5468177de979677cac11da84d1e0302c52b72085915b9d1b3496107172e5726520d51dad1981daf64

View File

@ -0,0 +1,302 @@
From a8835aab2c15e794fce13bd927295719e384ad2d Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Thu, 28 Jun 2018 07:10:35 +0200
Subject: [PATCH] fix php_url fields usage for PHP 7.3
---
php_ssh2.h | 8 ++++++++
ssh2_fopen_wrappers.c | 55 ++++++++++++++++++++++++++++++++-------------------
ssh2_sftp.c | 20 +++++++++----------
3 files changed, 53 insertions(+), 30 deletions(-)
diff --git a/php_ssh2.h b/php_ssh2.h
index 734b795..d010ff9 100644
--- a/php_ssh2.h
+++ b/php_ssh2.h
@@ -166,6 +166,14 @@ extern php_stream_wrapper php_ssh2_sftp_wrapper;
extern int le_ssh2_session;
extern int le_ssh2_sftp;
+#if PHP_VERSION_ID < 70300
+#define SSH2_URL_STR(a) (a)
+#define SSH2_URL_LEN(a) strlen(a)
+#else
+#define SSH2_URL_STR(a) ZSTR_VAL(a)
+#define SSH2_URL_LEN(a) ZSTR_LEN(a)
+#endif
+
#endif /* PHP_SSH2_H */
/*
diff --git a/ssh2_fopen_wrappers.c b/ssh2_fopen_wrappers.c
index 2f96ca4..f2f3475 100644
--- a/ssh2_fopen_wrappers.c
+++ b/ssh2_fopen_wrappers.c
@@ -215,7 +215,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
php_url *resource;
zval *methods = NULL, *callbacks = NULL, zsession, *tmpzval;
zend_long resource_id;
- char *h, *s, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
+ char *h, *username = NULL, *password = NULL, *pubkey_file = NULL, *privkey_file = NULL;
int username_len = 0, password_len = 0;
h = strstr(path, "Resource id #");
@@ -233,13 +233,13 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
return NULL;
}
- if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {
+ if (strncmp(SSH2_URL_STR(resource->scheme), "ssh2.", sizeof("ssh2.") - 1)) {
/* Not an ssh wrapper */
php_url_free(resource);
return NULL;
}
- if (strcmp(resource->scheme + sizeof("ssh2.") - 1, type)) {
+ if (strcmp(SSH2_URL_STR(resource->scheme) + sizeof("ssh2.") - 1, type)) {
/* Wrong ssh2. wrapper type */
php_url_free(resource);
return NULL;
@@ -253,13 +253,27 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
Find resource->path in the path string, then copy the entire string from the original path.
This includes ?query#fragment in the path string
*/
+// TODO copy seems uneeded
+#if PHP_VERSION_ID < 70300
+ {
+ char * s;
+
s = resource->path;
resource->path = estrdup(strstr(path, resource->path));
efree(s);
+ }
+#else
+ {
+ zend_string *tmp;
+
+ tmp = resource->path;
+ resource->path = zend_string_init(ZSTR_VAL(resource->path), ZSTR_LEN(resource->path), 0);
+ zend_string_release(tmp);
+ }
+#endif
/* Look for a resource ID to reuse a session */
- s = resource->host;
- if (is_numeric_string(s, strlen(s), &resource_id, NULL, 0) == IS_LONG) {
+ if (is_numeric_string(SSH2_URL_STR(resource->host), SSH2_URL_LEN(resource->host), &resource_id, NULL, 0) == IS_LONG) {
php_ssh2_sftp_data *sftp_data;
zval *zresource;
@@ -309,7 +323,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
}
/* Fallback on finding it in the context */
- if (resource->host[0] == 0 && context && psftp &&
+ if (SSH2_URL_STR(resource->host)[0] == 0 && context && psftp &&
(tmpzval = php_stream_context_get_option(context, "ssh2", "sftp")) != NULL &&
Z_TYPE_P(tmpzval) == IS_RESOURCE) {
php_ssh2_sftp_data *sftp_data;
@@ -323,7 +337,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
return resource;
}
}
- if (resource->host[0] == 0 && context &&
+ if (SSH2_URL_STR(resource->host)[0] == 0 && context &&
(tmpzval = php_stream_context_get_option(context, "ssh2", "session")) != NULL &&
Z_TYPE_P(tmpzval) == IS_RESOURCE) {
session = (LIBSSH2_SESSION *)zend_fetch_resource(Z_RES_P(tmpzval), PHP_SSH2_SESSION_RES_NAME, le_ssh2_session);
@@ -399,19 +413,19 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
}
if (resource->user) {
- int len = strlen(resource->user);
+ int len = SSH2_URL_LEN(resource->user);
if (len) {
- username = resource->user;
+ username = SSH2_URL_STR(resource->user);
username_len = len;
}
}
if (resource->pass) {
- int len = strlen(resource->pass);
+ int len = SSH2_URL_LEN(resource->pass);
if (len) {
- password = resource->pass;
+ password = SSH2_URL_STR(resource->pass);
password_len = len;
}
}
@@ -422,7 +436,7 @@ php_url *php_ssh2_fopen_wraper_parse_path(const char *path, char *type, php_stre
return NULL;
}
- session = php_ssh2_session_connect(resource->host, resource->port, methods, callbacks);
+ session = php_ssh2_session_connect(SSH2_URL_STR(resource->host), resource->port, methods, callbacks);
if (!session) {
/* Unable to connect! */
php_url_free(resource);
@@ -482,6 +496,7 @@ session_authed:
*psftp = sftp;
}
+ //TODO may be undefined
*presource_id = Z_LVAL(zsession);
*psession = session;
@@ -527,7 +542,7 @@ static php_stream *php_ssh2_shell_open(LIBSSH2_SESSION *session, int resource_id
zval_copy_ctor(&copyval);
convert_to_string(&copyval);
if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) {
- php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
+ php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval));
}
zval_dtor(&copyval);
}
@@ -631,7 +646,7 @@ static php_stream *php_ssh2_fopen_wrapper_shell(php_stream_wrapper *wrapper, con
zval_ptr_dtor(&copyval);
}
- s = resource->path ? resource->path : NULL;
+ s = resource->path ? SSH2_URL_STR(resource->path) : NULL;
if (s && s[0] == '/') {
/* Terminal type encoded into URL overrides context terminal type */
@@ -766,7 +781,7 @@ static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, int resource_
zval_copy_ctor(&copyval);
convert_to_string(&copyval);
if (libssh2_channel_setenv_ex(channel, key->val, key->len, Z_STRVAL(copyval), Z_STRLEN(copyval))) {
- php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", key, Z_STRVAL(copyval));
+ php_error_docref(NULL, E_WARNING, "Failed setting %s=%s on remote end", ZSTR_VAL(key), Z_STRVAL(copyval));
}
zval_dtor(&copyval);
}
@@ -878,7 +893,7 @@ static php_stream *php_ssh2_fopen_wrapper_exec(php_stream_wrapper *wrapper, cons
zval_ptr_dtor(copyval);
}
- stream = php_ssh2_exec_command(session, resource_id, resource->path + 1, terminal, terminal_len, environment, width, height, type);
+ stream = php_ssh2_exec_command(session, resource_id, SSH2_URL_STR(resource->path) + 1, terminal, terminal_len, environment, width, height, type);
if (!stream) {
// TODO Sean-Der
//zend_list_delete(resource_id);
@@ -1021,7 +1036,7 @@ static php_stream *php_ssh2_fopen_wrapper_scp(php_stream_wrapper *wrapper, const
return NULL;
}
- stream = php_ssh2_scp_xfer(session, resource_id, resource->path);
+ stream = php_ssh2_scp_xfer(session, resource_id, SSH2_URL_STR(resource->path));
if (!stream) {
//TODO Sean-Der
//zend_list_delete(resource_id);
@@ -1147,7 +1162,7 @@ PHP_FUNCTION(ssh2_scp_send)
char *error_msg = NULL;
last_error = libssh2_session_last_error(session, &error_msg, NULL, 0);
- php_error_docref(NULL, E_WARNING, "Failure creating remote file: %s", error_msg);
+ php_error_docref(NULL, E_WARNING, "Failure creating remote file: %s (%d)", error_msg, last_error);
php_stream_close(local_file);
RETURN_FALSE;
}
@@ -1262,10 +1277,10 @@ static php_stream *php_ssh2_fopen_wrapper_tunnel(php_stream_wrapper *wrapper, co
return NULL;
}
- if (resource->path && resource->path[0] == '/') {
+ if (resource->path && SSH2_URL_STR(resource->path)[0] == '/') {
char *colon;
- host = resource->path + 1;
+ host = SSH2_URL_STR(resource->path) + 1;
if (*host == '[') {
/* IPv6 Encapsulated Format */
host++;
diff --git a/ssh2_sftp.c b/ssh2_sftp.c
index 13f89f0..6332be8 100644
--- a/ssh2_sftp.c
+++ b/ssh2_sftp.c
@@ -238,7 +238,7 @@ static php_stream *php_ssh2_sftp_stream_opener(php_stream_wrapper *wrapper, cons
flags = php_ssh2_parse_fopen_modes((char *)mode);
- handle = libssh2_sftp_open(sftp, resource->path, flags, perms);
+ handle = libssh2_sftp_open(sftp, SSH2_URL_STR(resource->path), flags, perms);
if (!handle) {
php_error_docref(NULL, E_WARNING, "Unable to open %s on remote host", filename);
php_url_free(resource);
@@ -341,7 +341,7 @@ static php_stream *php_ssh2_sftp_dirstream_opener(php_stream_wrapper *wrapper, c
return NULL;
}
- handle = libssh2_sftp_opendir(sftp, resource->path);
+ handle = libssh2_sftp_opendir(sftp, SSH2_URL_STR(resource->path));
if (!handle) {
php_error_docref(NULL, E_WARNING, "Unable to open %s on remote host", filename);
php_url_free(resource);
@@ -386,7 +386,7 @@ static int php_ssh2_sftp_urlstat(php_stream_wrapper *wrapper, const char *url, i
return -1;
}
- if (libssh2_sftp_stat_ex(sftp, resource->path, strlen(resource->path),
+ if (libssh2_sftp_stat_ex(sftp, SSH2_URL_STR(resource->path), SSH2_URL_LEN(resource->path),
(flags & PHP_STREAM_URL_STAT_LINK) ? LIBSSH2_SFTP_LSTAT : LIBSSH2_SFTP_STAT, &attrs)) {
php_url_free(resource);
//zend_list_delete(sftp_rsrcid);
@@ -420,7 +420,7 @@ static int php_ssh2_sftp_unlink(php_stream_wrapper *wrapper, const char *url, in
return 0;
}
- result = libssh2_sftp_unlink(sftp, resource->path);
+ result = libssh2_sftp_unlink(sftp, SSH2_URL_STR(resource->path));
php_url_free(resource);
//zend_list_delete(sftp_rsrcid);
@@ -462,7 +462,7 @@ static int php_ssh2_sftp_rename(php_stream_wrapper *wrapper, const char *url_fro
return 0;
}
- result = libssh2_sftp_rename(sftp, resource->path, resource_to->path);
+ result = libssh2_sftp_rename(sftp, SSH2_URL_STR(resource->path), SSH2_URL_STR(resource_to->path));
php_url_free(resource);
php_url_free(resource_to);
@@ -493,13 +493,13 @@ static int php_ssh2_sftp_mkdir(php_stream_wrapper *wrapper, const char *url, int
if (options & PHP_STREAM_MKDIR_RECURSIVE) {
/* Just attempt to make every directory, some will fail, but we only care about the last success/failure */
- char *p = resource->path;
+ char *p = SSH2_URL_STR(resource->path);
while ((p = strchr(p + 1, '/'))) {
- libssh2_sftp_mkdir_ex(sftp, resource->path, p - resource->path, mode);
+ libssh2_sftp_mkdir_ex(sftp, SSH2_URL_STR(resource->path), p - SSH2_URL_STR(resource->path), mode);
}
}
- result = libssh2_sftp_mkdir(sftp, resource->path, mode);
+ result = libssh2_sftp_mkdir(sftp, SSH2_URL_STR(resource->path), mode);
php_url_free(resource);
//zend_list_delete(sftp_rsrcid);
@@ -527,7 +527,7 @@ static int php_ssh2_sftp_rmdir(php_stream_wrapper *wrapper, const char *url, int
return 0;
}
- result = libssh2_sftp_rmdir(sftp, resource->path);
+ result = libssh2_sftp_rmdir(sftp, SSH2_URL_STR(resource->path));
php_url_free(resource);
//zend_list_delete(sftp_rsrcid);
@@ -836,7 +836,7 @@ PHP_FUNCTION(ssh2_sftp_readlink)
}
if ((targ_len = libssh2_sftp_symlink_ex(data->sftp, link->val, link->len, targ, 8192, LIBSSH2_SFTP_READLINK)) < 0) {
- php_error_docref(NULL, E_WARNING, "Unable to read link '%s'", link);
+ php_error_docref(NULL, E_WARNING, "Unable to read link '%s'", ZSTR_VAL(link));
RETURN_FALSE;
}
--
2.1.4

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>php-bugs@gentoo.org</email>
<name>PHP</name>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,19 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
PHP_EXT_NAME="ssh2"
USE_PHP="php7-2 php7-3 php7-4 php8-0"
inherit php-ext-pecl-r3
DESCRIPTION="PHP bindings for the libssh2 library"
LICENSE="PHP-3.01"
SLOT="7"
IUSE=""
KEYWORDS="~amd64 ~x86"
# Upstream notes say there are errors with gcrypt backend
DEPEND=">=net-libs/libssh2-1.2[-gcrypt]"
RDEPEND="${DEPEND}"