public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-uploadprogress/, dev-php/pecl-uploadprogress/files/
@ 2020-03-06 17:15 Michael Orlitzky
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Orlitzky @ 2020-03-06 17:15 UTC (permalink / raw
  To: gentoo-commits

commit:     6ad0e787c9a3e8cddbc787b1420dc9551cbc55e1
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  6 17:14:21 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Mar  6 17:14:37 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ad0e787

dev-php/pecl-uploadprogress: new version 1.1.3.

This new version supports all newer slots of PHP, making our custom
patches obsolete. Thanks to Reuben Farrelly for the heads-up!

Closes: https://bugs.gentoo.org/711658
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-php/pecl-uploadprogress/Manifest               |   2 +-
 .../pecl-uploadprogress/files/1.0.3.1-php7.patch   | 148 ---------------------
 ...-r4.ebuild => pecl-uploadprogress-1.1.3.ebuild} |  15 ++-
 3 files changed, 9 insertions(+), 156 deletions(-)

diff --git a/dev-php/pecl-uploadprogress/Manifest b/dev-php/pecl-uploadprogress/Manifest
index fe1058ee715..ce8d10d0aef 100644
--- a/dev-php/pecl-uploadprogress/Manifest
+++ b/dev-php/pecl-uploadprogress/Manifest
@@ -1 +1 @@
-DIST uploadprogress-1.0.3.1.tgz 9040 BLAKE2B b926ee0cc7d40276425ea8eed86c5934c35ff2436b5785888394927a145620caa335d4eae87fd85bd754f8a67c1562f3b8d23a2c626f0d0ca4bed4bf4872e465 SHA512 c317a30ed81430184b643e2755867cdccf9848312aa31a5527e4fe229ac19ee3099121de8e253207b55dd7e788c28720bd3c477663c4ca15100478647a6dc1bb
+DIST uploadprogress-1.1.3.tgz 14798 BLAKE2B 5edda3e8672bb0e0829d100284240fcceac26be695386225a18446c742f59edfd906a9ae2f17b594816d3cddea02eb648db01a3352d7f8bd764ad2f6b2e03628 SHA512 2202f419be852a71eadae47eaa83909a032e5a6bbe4ce17ae5d45ea4e9f6d9c9edceb2111630d1f0e277b531d463accf540288ecbcca9bf154fe01754f225686

diff --git a/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch b/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch
deleted file mode 100644
index c90f4bd9539..00000000000
--- a/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From 7a4d6b3ac3575caedf9429940f54688411cbf5e9 Mon Sep 17 00:00:00 2001
-From: Jan-E <github@ehrhardt.nl>
-Date: Sun, 19 Apr 2015 18:49:48 +0200
-Subject: [PATCH 1/2] PHP7 compatibility
-
----
- uploadprogress.c | 36 +++++++++++++++++++++++++++++++++---
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/uploadprogress.c b/uploadprogress.c
-index 30f6758..7a52ba7 100644
---- a/uploadprogress.c
-+++ b/uploadprogress.c
-@@ -71,7 +71,7 @@ PHPAPI extern int (*php_rfc1867_callback)(unsigned int , void *, void ** TSRMLS_
-  */
- static int uploadprogress_php_rfc1867_file(unsigned int event, void  *event_data, void **data TSRMLS_DC)
- {
--    zval handler;
-+    //zval handler;
-     char *callable = NULL;
-     uploadprogress_data * progress;
-     int read_bytes;
-@@ -157,7 +157,11 @@ static int uploadprogress_php_rfc1867_file(unsigned int event, void  *event_data
- 
-             if (get_contents) {
-                 php_stream *stream;
-+#if defined(ZEND_ENGINE_3)
-+                int options = 0;
-+#else
-                 int options = ENFORCE_SAFE_MODE;
-+#endif
- 
-                 stream = php_stream_open_wrapper(progress->data_filename, "ab", options, NULL);
-                 if (stream) {
-@@ -301,7 +305,7 @@ PHP_FUNCTION(uploadprogress_get_info)
- {
-     char * id;
-     int id_lg;
--    char method;
-+    //char method;
- 
-     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_lg) == FAILURE) {
-         return;
-@@ -417,7 +421,11 @@ static void uploadprogress_file_php_get_info(char * id, zval * return_value)
-                         v[index] = 0;
-                     }
-                 }
-+#if defined(ZEND_ENGINE_3)
-+                add_assoc_string( return_value, k, v );
-+#else
-                 add_assoc_string( return_value, k, v, 1 );
-+#endif
-             }
-             fclose(F);
-         }
-@@ -432,10 +440,22 @@ static void uploadprogress_file_php_get_info(char * id, zval * return_value)
-  */
- static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long maxlen, zval *return_value)
- {
-+#if defined(ZEND_ENGINE_3)
-+    char *filename, *template, *data_identifier;
-+    zend_string *contents;
-+#else
-     char *filename, *template, *contents, *data_identifier;
-+#endif
-     php_stream *stream;
-+#if defined(ZEND_ENGINE_3)
-+    int options = 0;
-+#else
-     int options = ENFORCE_SAFE_MODE;
--    int len, newlen;
-+#endif
-+    int len;
-+#if PHP_API_VERSION < 20100412
-+    int newlen;
-+#endif
-     TSRMLS_FETCH();
- 
-     template = INI_STR("uploadprogress.file.contents_template");
-@@ -455,7 +475,13 @@ static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long
-         }
- 
-         /* uses mmap if possible */
-+#if defined(ZEND_ENGINE_3)
-+        contents = php_stream_copy_to_mem(stream, maxlen, 0);
-+        len = contents->len;
-+        if (contents && len > 0) {
-+#else
-         if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
-+#endif
- 
- #if PHP_API_VERSION < 20100412
-             if (PG(magic_quotes_runtime)) {
-@@ -463,7 +489,11 @@ static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long
-                 len = newlen;
-             }
- #endif
-+#if defined(ZEND_ENGINE_3)
-+            RETVAL_STR(contents);
-+#else
-             RETVAL_STRINGL(contents, len, 0);
-+#endif
-         } else if (len == 0) {
-             RETVAL_EMPTY_STRING();
-         } else {
--- 
-2.1.4
-
-
-From 95d8a0fd4554e10c215d3ab301e901bd8f99c5d9 Mon Sep 17 00:00:00 2001
-From: Jan-E <github@ehrhardt.nl>
-Date: Mon, 20 Apr 2015 22:20:40 +0200
-Subject: [PATCH 2/2] int id_lg should be size_t id_lg
-
----
- uploadprogress.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/uploadprogress.c b/uploadprogress.c
-index 7a52ba7..3d73d15 100644
---- a/uploadprogress.c
-+++ b/uploadprogress.c
-@@ -304,7 +304,11 @@ PHP_MINFO_FUNCTION(uploadprogress)
- PHP_FUNCTION(uploadprogress_get_info)
- {
-     char * id;
-+#if defined(ZEND_ENGINE_3)
-+    size_t id_lg;
-+#else
-     int id_lg;
-+#endif
-     //char method;
- 
-     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_lg) == FAILURE) {
--- 
-2.1.4
-
---- a/uploadprogress.c	2011-08-15 09:21:10.000000000 -0400
-+++ b/uploadprogress.c	2016-12-07 11:05:47.961377088 -0500
-@@ -213,7 +213,7 @@
-             FILE *F;
-             F = VCWD_FOPEN(progress->identifier_tmp, "wb");
-             if (F) {
--                fprintf(F, "upload_id=%s\nfieldname=%s\nfilename=%s\ntime_start=%d\ntime_last=%d\nspeed_average=%d\nspeed_last=%d\nbytes_uploaded=%d\nbytes_total=%d\nfiles_uploaded=%d\nest_sec=%d\n",
-+                fprintf(F, "upload_id=%s\nfieldname=%s\nfilename=%s\ntime_start=%ld\ntime_last=%ld\nspeed_average=%d\nspeed_last=%d\nbytes_uploaded=%ld\nbytes_total=%ld\nfiles_uploaded=%d\nest_sec=%d\n",
-                 progress->upload_id, progress->fieldname, progress->filename,
-                 progress->time_start, progress->time_last,
-                 progress->speed_average, progress->speed_last,

diff --git a/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r4.ebuild b/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.1.3.ebuild
similarity index 56%
rename from dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r4.ebuild
rename to dev-php/pecl-uploadprogress/pecl-uploadprogress-1.1.3.ebuild
index a11f8d2eeea..a19bb78b273 100644
--- a/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r4.ebuild
+++ b/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.1.3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-USE_PHP="php5-6 php7-0 php7-1 php7-2 php7-3 php7-4"
+USE_PHP="php7-2 php7-3 php7-4"
 
 inherit php-ext-pecl-r3
 
@@ -11,14 +11,15 @@ DESCRIPTION="An extension to track progress of a file upload"
 LICENSE="PHP-3.01"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
+IUSE="examples"
 
 RDEPEND="
-	php_targets_php5-6? ( dev-lang/php:5.6[apache2] )
-	php_targets_php7-0? ( dev-lang/php:7.0[apache2] )
-	php_targets_php7-1? ( dev-lang/php:7.1[apache2] )
 	php_targets_php7-2? ( dev-lang/php:7.2[apache2] )
 	php_targets_php7-3? ( dev-lang/php:7.3[apache2] )
 	php_targets_php7-4? ( dev-lang/php:7.4[apache2] )
 "
-PATCHES=( "${FILESDIR}/1.0.3.1-php7.patch" )
+
+src_install() {
+	default
+	use examples && dodoc -r examples
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-uploadprogress/, dev-php/pecl-uploadprogress/files/
@ 2023-05-22 14:37 Michael Orlitzky
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Orlitzky @ 2023-05-22 14:37 UTC (permalink / raw
  To: gentoo-commits

commit:     149dee72b9bfab759a40fdf116590033c4dbca34
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon May 22 14:30:09 2023 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon May 22 14:36:50 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=149dee72

dev-php/pecl-uploadprogress: fix tests with PHP's --enable-debug.

A few of the tests for pecl-uploadprogress throw a fatal error if
PHP was build with USE=debug. We skip the tests for now; a better
long-term solution was proposed upstream (GH issue #17).

In addition, the extension seems to work fine with php-8.2, so I've
taken the opportunity to enable it.

Closes: https://bugs.gentoo.org/906691
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../files/php-debug-testfix.patch                  | 74 ++++++++++++++++++++++
 ....ebuild => pecl-uploadprogress-2.0.2-r1.ebuild} |  7 +-
 2 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/dev-php/pecl-uploadprogress/files/php-debug-testfix.patch b/dev-php/pecl-uploadprogress/files/php-debug-testfix.patch
new file mode 100644
index 000000000000..febc989ab79b
--- /dev/null
+++ b/dev-php/pecl-uploadprogress/files/php-debug-testfix.patch
@@ -0,0 +1,74 @@
+From 57f3c17c684a4e5607a322a24be306eb98d340ac Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 22 May 2023 10:18:29 -0400
+Subject: [PATCH 1/1] tests: skip tests that fail with --enable-debug.
+
+With PHP debugging enabled, a few tests fail. The root cause of this
+is that uploadprogress_get_contents() can return FALSE to indicate
+that an error has occurred, but its declared type is string. It
+would probably be better if the function raised an error rather
+than abusing the return value, but that's a decision upstream
+would have to agree too (see: Github issue 17). For now we just
+skip the tests if PHP_DEBUG is defined.
+---
+ tests/uploadprogress_get_contents_error001.phpt     | 2 ++
+ tests/uploadprogress_get_contents_error003.phpt     | 2 ++
+ tests/uploadprogress_get_contents_variation002.phpt | 2 ++
+ tests/uploadprogress_get_contents_variation006.phpt | 2 ++
+ 4 files changed, 8 insertions(+)
+
+diff --git a/tests/uploadprogress_get_contents_error001.phpt b/tests/uploadprogress_get_contents_error001.phpt
+index 63f4f5d..c3e10d9 100644
+--- a/tests/uploadprogress_get_contents_error001.phpt
++++ b/tests/uploadprogress_get_contents_error001.phpt
+@@ -5,6 +5,8 @@ uploadprogress_get_contents - Warns when function is disabled
+ <?php
+ if (!extension_loaded('uploadprogress')) exit('skip extension not loaded');
+ 
++if (PHP_DEBUG) exit('skip test throws a fatal error with --enable-debug');
++
+ --INI--
+ uploadprogress.get_contents = Off
+ 
+diff --git a/tests/uploadprogress_get_contents_error003.phpt b/tests/uploadprogress_get_contents_error003.phpt
+index 1ea19b8..65d94c1 100644
+--- a/tests/uploadprogress_get_contents_error003.phpt
++++ b/tests/uploadprogress_get_contents_error003.phpt
+@@ -5,6 +5,8 @@ uploadprogress_get_contents - Warns when maxlength is less than zero
+ <?php
+ if (!extension_loaded('uploadprogress')) exit('skip extension not loaded');
+ 
++if (PHP_DEBUG) exit('skip test throws a fatal error with --enable-debug');
++
+ --INI--
+ uploadprogress.get_contents = On
+ 
+diff --git a/tests/uploadprogress_get_contents_variation002.phpt b/tests/uploadprogress_get_contents_variation002.phpt
+index b4bf458..67b1b89 100644
+--- a/tests/uploadprogress_get_contents_variation002.phpt
++++ b/tests/uploadprogress_get_contents_variation002.phpt
+@@ -5,6 +5,8 @@ uploadprogress_get_contents - File contents not found
+ <?php
+ if (!extension_loaded('uploadprogress')) exit('skip extension not loaded');
+ 
++if (PHP_DEBUG) exit('skip test throws a fatal error with --enable-debug');
++
+ --INI--
+ uploadprogress.get_contents = On
+ 
+diff --git a/tests/uploadprogress_get_contents_variation006.phpt b/tests/uploadprogress_get_contents_variation006.phpt
+index e19f8d5..ec70c78 100644
+--- a/tests/uploadprogress_get_contents_variation006.phpt
++++ b/tests/uploadprogress_get_contents_variation006.phpt
+@@ -5,6 +5,8 @@ uploadprogress_get_contents - When contents file cannot be read
+ <?php
+ if (!extension_loaded('uploadprogress')) exit('skip extension not loaded');
+ 
++if (PHP_DEBUG) exit('skip test throws a fatal error with --enable-debug');
++
+ --INI--
+ uploadprogress.get_contents = On
+ 
+-- 
+2.39.3
+

diff --git a/dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2.ebuild b/dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2-r1.ebuild
similarity index 71%
rename from dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2.ebuild
rename to dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2-r1.ebuild
index 99572c452134..49f75395edd0 100644
--- a/dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2.ebuild
+++ b/dev-php/pecl-uploadprogress/pecl-uploadprogress-2.0.2-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-USE_PHP="php7-4 php8-0 php8-1"
+USE_PHP="php7-4 php8-0 php8-1 php8-2"
 PHP_EXT_SAPIS="apache2 fpm"
 
 inherit php-ext-pecl-r3
@@ -14,8 +14,11 @@ SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="examples"
 
+PATCHES=( "${FILESDIR}/php-debug-testfix.patch" )
+
 RDEPEND="
 	php_targets_php7-4? ( || ( dev-lang/php:7.4[apache2(-),fileinfo(-)] dev-lang/php:7.4[fileinfo(-),fpm(-)] ) )
 	php_targets_php8-0? ( || ( dev-lang/php:8.0[apache2(-),fileinfo(-)] dev-lang/php:8.0[fileinfo(-),fpm(-)] ) )
 	php_targets_php8-1? ( || ( dev-lang/php:8.1[apache2(-),fileinfo(-)] dev-lang/php:8.1[fileinfo(-),fpm(-)] ) )
+	php_targets_php8-2? ( || ( dev-lang/php:8.2[apache2(-),fileinfo(-)] dev-lang/php:8.2[fileinfo(-),fpm(-)] ) )
 "


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-22 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06 17:15 [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-uploadprogress/, dev-php/pecl-uploadprogress/files/ Michael Orlitzky
  -- strict thread matches above, loose matches on Subject: below --
2023-05-22 14:37 Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox