* [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
@ 2021-11-23 22:51 Michael Orlitzky
0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2021-11-23 22:51 UTC (permalink / raw
To: gentoo-commits
commit: 6c5283e1c0774fc35d1ad5dc0e8eb492a848f9c9
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 23 22:46:06 2021 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Nov 23 22:46:19 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c5283e1
app-admin/drush: new revision to silence deprecation warnings.
I'm still happily using this to update some drupal-7.x sites, but with
php-7.4, there are a few deprecation warnings that will later become
errors in php-8.0. The fixes are trivial, so I've added a small patch
to cure them.
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
app-admin/drush/drush-6.7.0-r3.ebuild | 66 ++++++++++++++++++++++++++++++++
app-admin/drush/files/array-syntax.patch | 58 ++++++++++++++++++++++++++++
2 files changed, 124 insertions(+)
diff --git a/app-admin/drush/drush-6.7.0-r3.ebuild b/app-admin/drush/drush-6.7.0-r3.ebuild
new file mode 100644
index 000000000000..38e4125922de
--- /dev/null
+++ b/app-admin/drush/drush-6.7.0-r3.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1
+
+DESCRIPTION="Command line shell and scripting interface for Drupal"
+HOMEPAGE="https://github.com/drush-ops/drush"
+SRC_URI="https://github.com/drush-ops/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="dev-lang/php[cli,ctype,json(+),simplexml]
+ dev-php/PEAR-Console_Table"
+
+PATCHES=(
+ "${FILESDIR}/update-bash-completion-script-for-2.1.patch"
+ "${FILESDIR}/array-syntax.patch"
+)
+
+src_prepare() {
+ default
+
+ # dodoc compresses all of the documentation, so we fix the filenames
+ # in a few places.
+ #
+ # First, the README location in bootstrap.inc.
+ sed -i -e \
+ "s!/share/doc/drush!/share/doc/${PF}!" \
+ -e "s!README\.md!\0.bz2!g" \
+ includes/bootstrap.inc || die
+
+ # Next, the list of documentation in docs.drush.inc. Note that
+ # html files don't get compressed.
+ sed -i \
+ -e "s!\.bashrc'!.bashrc.bz2'!" \
+ -e "s!\.inc'!.inc.bz2'!" \
+ -e "s!\.ini'!.ini.bz2'!" \
+ -e "s!\.md'!.md.bz2'!" \
+ -e "s!\.php'!.php.bz2'!" \
+ -e "s!\.script'!.script.bz2'!" \
+ -e "s!\.txt'!.txt.bz2'!" \
+ commands/core/docs.drush.inc || die
+}
+
+src_install() {
+ # Always install the examples; they're referenced within the source
+ # code and too difficult to exorcise.
+ dodoc -r README.md docs examples
+
+ insinto /usr/share/drush
+ doins -r classes commands includes lib misc
+ doins drush_logo-black.png drush.info drush.php
+
+ exeinto /usr/share/drush
+ doexe drush
+ dosym ../share/drush/drush /usr/bin/drush
+
+ keepdir /etc/drush
+ newbashcomp drush.complete.sh drush
+}
diff --git a/app-admin/drush/files/array-syntax.patch b/app-admin/drush/files/array-syntax.patch
new file mode 100644
index 000000000000..60abeea984e5
--- /dev/null
+++ b/app-admin/drush/files/array-syntax.patch
@@ -0,0 +1,58 @@
+From 354d3d4f7a0c56926bd5124d2ec5bb363a9f9bc8 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Tue, 23 Nov 2021 17:34:24 -0500
+Subject: [PATCH 1/1] includes: don't access array elements with curly braces.
+
+The array{idx} syntax was deprecated in php-7.4 and has been removed
+in php-8.0. It's trivial to use square brackets, like array[idx],
+instead; so we do it.
+---
+ includes/command.inc | 6 +++---
+ includes/sitealias.inc | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/includes/command.inc b/includes/command.inc
+index af039ad..ed0e817 100644
+--- a/includes/command.inc
++++ b/includes/command.inc
+@@ -749,16 +749,16 @@ function drush_parse_args() {
+ $command_args[] = $opt;
+ }
+ // Is the arg an option (starting with '-')?
+- if (!empty($opt) && $opt{0} == "-" && strlen($opt) != 1) {
++ if (!empty($opt) && $opt[0] == "-" && strlen($opt) != 1) {
+ // Do we have multiple options behind one '-'?
+- if (strlen($opt) > 2 && $opt{1} != "-") {
++ if (strlen($opt) > 2 && $opt[1] != "-") {
+ // Each char becomes a key of its own.
+ for ($j = 1; $j < strlen($opt); $j++) {
+ $options[substr($opt, $j, 1)] = true;
+ }
+ }
+ // Do we have a longopt (starting with '--')?
+- elseif ($opt{1} == "-") {
++ elseif ($opt[1] == "-") {
+ if ($pos = strpos($opt, '=')) {
+ $options[substr($opt, 2, $pos - 2)] = substr($opt, $pos + 1);
+ }
+diff --git a/includes/sitealias.inc b/includes/sitealias.inc
+index b9f0bb9..13a38c1 100644
+--- a/includes/sitealias.inc
++++ b/includes/sitealias.inc
+@@ -133,10 +133,10 @@ function drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_con
+ function drush_sitealias_valid_alias_format($alias) {
+ return ( (strpos($alias, ',') !== false) ||
+ ((strpos($alias, '@') === FALSE ? 0 : 1) + (strpos($alias, '/') === FALSE ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) ||
+- ($alias{0} == '#') ||
+- ($alias{0} == '@')
++ ($alias[0] == '#') ||
++ ($alias[0] == '@')
+ );
+- return $alias{0} == '@';
++ return $alias[0] == '@';
+ }
+
+ /**
+--
+2.32.0
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
@ 2022-09-27 1:25 Michael Orlitzky
0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2022-09-27 1:25 UTC (permalink / raw
To: gentoo-commits
commit: 06d8c8e98a620bf36af1ef4032c630eaf21e098c
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 27 01:09:37 2022 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 01:23:04 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06d8c8e9
app-admin/drush: new revision with better php8 support and a bugfix.
Closes: https://bugs.gentoo.org/865483
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
app-admin/drush/drush-6.7.0-r4.ebuild | 68 ++++++++++++++++++
app-admin/drush/files/drush-6.7.0-gzip-mime.patch | 25 +++++++
app-admin/drush/files/drush-6.7.0-php8.0.patch | 87 +++++++++++++++++++++++
3 files changed, 180 insertions(+)
diff --git a/app-admin/drush/drush-6.7.0-r4.ebuild b/app-admin/drush/drush-6.7.0-r4.ebuild
new file mode 100644
index 000000000000..06b318dd0663
--- /dev/null
+++ b/app-admin/drush/drush-6.7.0-r4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1
+
+DESCRIPTION="Command line shell and scripting interface for Drupal"
+HOMEPAGE="https://github.com/drush-ops/drush"
+SRC_URI="https://github.com/drush-ops/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="dev-lang/php[cli,ctype,json(+),simplexml]
+ dev-php/PEAR-Console_Table"
+
+PATCHES=(
+ "${FILESDIR}/update-bash-completion-script-for-2.1.patch"
+ "${FILESDIR}/array-syntax.patch"
+ "${FILESDIR}/${P}-php8.0.patch"
+ "${FILESDIR}/${P}-gzip-mime.patch"
+)
+
+src_prepare() {
+ default
+
+ # dodoc compresses all of the documentation, so we fix the filenames
+ # in a few places.
+ #
+ # First, the README location in bootstrap.inc.
+ sed -i -e \
+ "s!/share/doc/drush!/share/doc/${PF}!" \
+ -e "s!README\.md!\0.bz2!g" \
+ includes/bootstrap.inc || die
+
+ # Next, the list of documentation in docs.drush.inc. Note that
+ # html files don't get compressed.
+ sed -i \
+ -e "s!\.bashrc'!.bashrc.bz2'!" \
+ -e "s!\.inc'!.inc.bz2'!" \
+ -e "s!\.ini'!.ini.bz2'!" \
+ -e "s!\.md'!.md.bz2'!" \
+ -e "s!\.php'!.php.bz2'!" \
+ -e "s!\.script'!.script.bz2'!" \
+ -e "s!\.txt'!.txt.bz2'!" \
+ commands/core/docs.drush.inc || die
+}
+
+src_install() {
+ # Always install the examples; they're referenced within the source
+ # code and too difficult to exorcise.
+ dodoc -r README.md docs examples
+
+ insinto /usr/share/drush
+ doins -r classes commands includes lib misc
+ doins drush_logo-black.png drush.info drush.php
+
+ exeinto /usr/share/drush
+ doexe drush
+ dosym ../share/drush/drush /usr/bin/drush
+
+ keepdir /etc/drush
+ newbashcomp drush.complete.sh drush
+}
diff --git a/app-admin/drush/files/drush-6.7.0-gzip-mime.patch b/app-admin/drush/files/drush-6.7.0-gzip-mime.patch
new file mode 100644
index 000000000000..53601c80fbda
--- /dev/null
+++ b/app-admin/drush/files/drush-6.7.0-gzip-mime.patch
@@ -0,0 +1,25 @@
+From 48a16a67ec072428339cc165743fedab6264edfe Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 26 Sep 2022 20:01:41 -0400
+Subject: [PATCH 1/4] includes/drush.inc: support application/gzip MIME type.
+
+This type is actually registered, as opposed to application/x-gzip.
+---
+ includes/drush.inc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/includes/drush.inc b/includes/drush.inc
+index f869b37..a748a0c 100644
+--- a/includes/drush.inc
++++ b/includes/drush.inc
+@@ -930,6 +930,7 @@ function drush_file_is_tarball($path) {
+ $content_type = drush_mime_content_type($path);
+ $supported = array(
+ 'application/x-bzip2',
++ 'application/gzip',
+ 'application/x-gzip',
+ 'application/x-tar',
+ 'application/x-zip',
+--
+2.35.1
+
diff --git a/app-admin/drush/files/drush-6.7.0-php8.0.patch b/app-admin/drush/files/drush-6.7.0-php8.0.patch
new file mode 100644
index 000000000000..33a4ee7ba98b
--- /dev/null
+++ b/app-admin/drush/files/drush-6.7.0-php8.0.patch
@@ -0,0 +1,87 @@
+From 7be49f4d78111372fc58d91132daf6c4230b08ba Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 26 Sep 2022 19:08:09 -0400
+Subject: [PATCH 1/3] includes/drush.inc: replace create_function() with
+ function(){...}
+
+---
+ includes/drush.inc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/includes/drush.inc b/includes/drush.inc
+index a748a0c..7b8dda3 100644
+--- a/includes/drush.inc
++++ b/includes/drush.inc
+@@ -987,9 +987,9 @@ function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE, $t
+ // Remove the header line.
+ array_shift($output);
+ // Remove the prefix verb from each line.
+- $output = array_map(create_function('$str', 'return substr($str, strpos($str, ":") + 3 + ' . strlen($destination) . ');'), $output);
++ $output = array_map(function($str){ return substr($str, strpos($str, ":") + 3 + strlen($destination)) ; }, $output);
+ // Remove any remaining blank lines.
+- $return = array_filter($output, create_function('$str', 'return $str != "";'));
++ $return = array_filter($output, function($str){return $str != "";});
+ }
+ }
+ // Otherwise we have a possibly-compressed Tar file.
+--
+2.35.1
+
+From f118117814ef690ec71f484dc3c4906f82d9c726 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 26 Sep 2022 19:32:13 -0400
+Subject: [PATCH 2/3] includes/backend.inc: replace usage of each().
+
+---
+ includes/backend.inc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/includes/backend.inc b/includes/backend.inc
+index d004850..0ca010d 100644
+--- a/includes/backend.inc
++++ b/includes/backend.inc
+@@ -355,8 +355,8 @@ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) {
+ if (count($cmds) && (count($open_processes) < $process_limit)) {
+ // Pop the site and command (key / value) from the cmds array
+ end($cmds);
+- list($site, $cmd) = each($cmds);
+- unset($cmds[$site]);
++ $site = key($cmds);
++ $cmd = array_pop($cmds);
+
+ if (is_array($cmd)) {
+ $c = $cmd['cmd'];
+--
+2.35.1
+
+From 7d718639b68bd09c262005cff133d24ffdf800f1 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 26 Sep 2022 19:36:29 -0400
+Subject: [PATCH 3/3] includes/environment.inc: default fifth parameter in
+ error handler.
+
+The fifth parameter was removed in php-8.0:
+
+ https://www.php.net/manual/en/function.set-error-handler.php
+
+We now default it to the empty array in drush_error_handler().
+---
+ includes/environment.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/includes/environment.inc b/includes/environment.inc
+index 7837104..8f2f414 100644
+--- a/includes/environment.inc
++++ b/includes/environment.inc
+@@ -24,7 +24,7 @@ define('CONSOLE_TABLE_BASE_URL', 'https://github.com/RobLoach/Console_Table/arch
+ * Log PHP errors to the Drush log. This is in effect until Drupal's error
+ * handler takes over.
+ */
+-function drush_error_handler($errno, $message, $filename, $line, $context) {
++function drush_error_handler($errno, $message, $filename, $line, $context=[]) {
+ // E_DEPRECATED was added in PHP 5.3. Drupal 6 will not fix all the
+ // deprecated errors, but suppresses them. So we suppress them as well.
+ if (defined('E_DEPRECATED')) {
+--
+2.35.1
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
@ 2023-08-03 13:29 Michael Orlitzky
0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2023-08-03 13:29 UTC (permalink / raw
To: gentoo-commits
commit: 86d95b5acf65ab3c47f645575728278d42c950e0
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 3 13:22:09 2023 +0000
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Aug 3 13:26:23 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86d95b5a
app-admin/drush: fix a "drush up" warning with php-8.1.
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
app-admin/drush/drush-6.7.0-r5.ebuild | 69 ++++++++++++++++++++++
.../drush-6.7.0-dont-pass-null-to-strtoupper.patch | 26 ++++++++
2 files changed, 95 insertions(+)
diff --git a/app-admin/drush/drush-6.7.0-r5.ebuild b/app-admin/drush/drush-6.7.0-r5.ebuild
new file mode 100644
index 000000000000..a4f2be23bf54
--- /dev/null
+++ b/app-admin/drush/drush-6.7.0-r5.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1
+
+DESCRIPTION="Command line shell and scripting interface for Drupal"
+HOMEPAGE="https://github.com/drush-ops/drush"
+SRC_URI="https://github.com/drush-ops/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="dev-lang/php[cli,ctype,json(+),simplexml]
+ dev-php/PEAR-Console_Table"
+
+PATCHES=(
+ "${FILESDIR}/update-bash-completion-script-for-2.1.patch"
+ "${FILESDIR}/array-syntax.patch"
+ "${FILESDIR}/${P}-php8.0.patch"
+ "${FILESDIR}/${P}-gzip-mime.patch"
+ "${FILESDIR}/${P}-dont-pass-null-to-strtoupper.patch"
+)
+
+src_prepare() {
+ default
+
+ # dodoc compresses all of the documentation, so we fix the filenames
+ # in a few places.
+ #
+ # First, the README location in bootstrap.inc.
+ sed -i -e \
+ "s!/share/doc/drush!/share/doc/${PF}!" \
+ -e "s!README\.md!\0.bz2!g" \
+ includes/bootstrap.inc || die
+
+ # Next, the list of documentation in docs.drush.inc. Note that
+ # html files don't get compressed.
+ sed -i \
+ -e "s!\.bashrc'!.bashrc.bz2'!" \
+ -e "s!\.inc'!.inc.bz2'!" \
+ -e "s!\.ini'!.ini.bz2'!" \
+ -e "s!\.md'!.md.bz2'!" \
+ -e "s!\.php'!.php.bz2'!" \
+ -e "s!\.script'!.script.bz2'!" \
+ -e "s!\.txt'!.txt.bz2'!" \
+ commands/core/docs.drush.inc || die
+}
+
+src_install() {
+ # Always install the examples; they're referenced within the source
+ # code and too difficult to exorcise.
+ dodoc -r README.md docs examples
+
+ insinto /usr/share/drush
+ doins -r classes commands includes lib misc
+ doins drush_logo-black.png drush.info drush.php
+
+ exeinto /usr/share/drush
+ doexe drush
+ dosym ../share/drush/drush /usr/bin/drush
+
+ keepdir /etc/drush
+ newbashcomp drush.complete.sh drush
+}
diff --git a/app-admin/drush/files/drush-6.7.0-dont-pass-null-to-strtoupper.patch b/app-admin/drush/files/drush-6.7.0-dont-pass-null-to-strtoupper.patch
new file mode 100644
index 000000000000..408a271ce38f
--- /dev/null
+++ b/app-admin/drush/files/drush-6.7.0-dont-pass-null-to-strtoupper.patch
@@ -0,0 +1,26 @@
+From 621cb8db059f3dff434dc369ab46faf3a2efa539 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 3 Aug 2023 08:52:35 -0400
+Subject: [PATCH 1/1] includes/environment.inc: don't pass null to
+ strtoupper().
+
+---
+ includes/environment.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/includes/environment.inc b/includes/environment.inc
+index 7837104..dd2c71d 100644
+--- a/includes/environment.inc
++++ b/includes/environment.inc
+@@ -736,7 +736,7 @@ function _drush_get_os($os = NULL) {
+ // that the path be converted to /cygdrive/c/path, even on DOS or Powershell.
+ // The special os "RSYNC" can be used to indicate that we want to assume
+ // "CWRSYNC" when cwrsync is installed, or default to the local OS otherwise.
+- if (strtoupper($os) == "RSYNC") {
++ if (isset($os) && strtoupper($os) == "RSYNC") {
+ $os = _drush_get_os("LOCAL");
+ // For now we assume that cwrsync is always installed on Windows, and never installed son any other platform.
+ return drush_is_windows($os) ? "CWRSYNC" : $os;
+--
+2.39.3
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
@ 2023-08-17 2:22 Michael Orlitzky
0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2023-08-17 2:22 UTC (permalink / raw
To: gentoo-commits
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
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-17 2:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 13:29 [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/ Michael Orlitzky
-- strict thread matches above, loose matches on Subject: below --
2023-08-17 2:22 Michael Orlitzky
2022-09-27 1:25 Michael Orlitzky
2021-11-23 22:51 Michael Orlitzky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox