From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1439945-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 703CB158094
	for <garchives@archives.gentoo.org>; Tue, 27 Sep 2022 01:25:30 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 35913E0AE7;
	Tue, 27 Sep 2022 01:25:29 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 1A1C5E0AE7
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Sep 2022 01:25:28 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D9AF5340CCE
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Sep 2022 01:25:27 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 0647E75
	for <gentoo-commits@lists.gentoo.org>; Tue, 27 Sep 2022 01:25:26 +0000 (UTC)
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" <mjo@gentoo.org>
Message-ID: <1664241784.06d8c8e98a620bf36af1ef4032c630eaf21e098c.mjo@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-admin/drush/drush-6.7.0-r4.ebuild app-admin/drush/files/drush-6.7.0-gzip-mime.patch app-admin/drush/files/drush-6.7.0-php8.0.patch
X-VCS-Directories: app-admin/drush/ app-admin/drush/files/
X-VCS-Committer: mjo
X-VCS-Committer-Name: Michael Orlitzky
X-VCS-Revision: 06d8c8e98a620bf36af1ef4032c630eaf21e098c
X-VCS-Branch: master
Date: Tue, 27 Sep 2022 01:25:26 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: eb22f843-79a9-4f3d-9e63-d0ca5f3d9750
X-Archives-Hash: 58351f617bb5684f6d5c15bc45e84b37

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
+