public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
Date: Thu, 17 Aug 2023 02:22:51 +0000 (UTC)	[thread overview]
Message-ID: <1692238860.3ccbcb06b62938bdcbfd15fa9507997c27ada8d0.mjo@gentoo> (raw)

commit:     3ccbcb06b62938bdcbfd15fa9507997c27ada8d0
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 17 02:21:00 2023 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Aug 17 02:21:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ccbcb06

app-admin/drush: another php-8.x modernization patch

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 ...drush-6.7.0-r5.ebuild => drush-6.7.0-r6.ebuild} |  1 +
 .../files/drush-6.7.0-batch-signature-fix.patch    | 46 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/app-admin/drush/drush-6.7.0-r5.ebuild b/app-admin/drush/drush-6.7.0-r6.ebuild
similarity index 97%
rename from app-admin/drush/drush-6.7.0-r5.ebuild
rename to app-admin/drush/drush-6.7.0-r6.ebuild
index a4f2be23bf54..88c5b8c4ab9b 100644
--- a/app-admin/drush/drush-6.7.0-r5.ebuild
+++ b/app-admin/drush/drush-6.7.0-r6.ebuild
@@ -24,6 +24,7 @@ PATCHES=(
 	"${FILESDIR}/${P}-php8.0.patch"
 	"${FILESDIR}/${P}-gzip-mime.patch"
 	"${FILESDIR}/${P}-dont-pass-null-to-strtoupper.patch"
+	"${FILESDIR}/${P}-batch-signature-fix.patch"
 )
 
 src_prepare() {

diff --git a/app-admin/drush/files/drush-6.7.0-batch-signature-fix.patch b/app-admin/drush/files/drush-6.7.0-batch-signature-fix.patch
new file mode 100644
index 000000000000..8d5aa74fed46
--- /dev/null
+++ b/app-admin/drush/files/drush-6.7.0-batch-signature-fix.patch
@@ -0,0 +1,46 @@
+From 31d7a945230eaf1f8ab94d5f782619434f7f2b8c Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 16 Aug 2023 21:21:39 -0400
+Subject: [PATCH 1/1] includes/batch.inc: synchronize sub and superclass
+ parameter names
+
+The DrushBatchContext class overrides the offsetSet() method of its
+superclass, ArrayObject, but changes the first parameter's name from
+$key to $name. This makes php-8.1 unhappy:
+
+  Error: Return type of DrushBatchContext::offsetSet($name, $value)
+  should either be compatible with ArrayObject::offsetSet(mixed $key,
+  mixed $value): void, or the #[\ReturnTypeWillChange] attribute should
+  be used to temporarily suppress the notice in .../batch.inc, line 37
+
+Renaming the parameter to $key throughout the function fixes the issue.
+---
+ includes/batch.inc | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/includes/batch.inc b/includes/batch.inc
+index dd4adc9..785f411 100644
+--- a/includes/batch.inc
++++ b/includes/batch.inc
+@@ -34,14 +34,14 @@
+  * @see _drush_batch_worker().
+  */
+ class DrushBatchContext extends ArrayObject {
+-  function offsetSet($name, $value) {
+-    if ($name == 'message') {
++  function offsetSet($key, $value) {
++    if ($key == 'message') {
+       drush_log(strip_tags($value), 'ok');
+     }
+-    elseif ($name == 'error_message') {
++    elseif ($key == 'error_message') {
+       drush_set_error('DRUSH_BATCH_ERROR', strip_tags($value));
+     }
+-    parent::offsetSet($name, $value);
++    parent::offsetSet($key, $value);
+   }
+ }
+ 
+-- 
+2.41.0
+


             reply	other threads:[~2023-08-17  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  2:22 Michael Orlitzky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-19  8:39 [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/ Petr Vaněk
2023-08-03 13:29 Michael Orlitzky
2022-09-27  1:25 Michael Orlitzky
2021-11-23 22:51 Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1692238860.3ccbcb06b62938bdcbfd15fa9507997c27ada8d0.mjo@gentoo \
    --to=mjo@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox