Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/drush/files/, app-admin/drush/
Date: Tue, 27 Sep 2022 01:25:30
Message-Id: 1664241784.06d8c8e98a620bf36af1ef4032c630eaf21e098c.mjo@gentoo
1 commit: 06d8c8e98a620bf36af1ef4032c630eaf21e098c
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 27 01:09:37 2022 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 01:23:04 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06d8c8e9
7
8 app-admin/drush: new revision with better php8 support and a bugfix.
9
10 Closes: https://bugs.gentoo.org/865483
11 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
12
13 app-admin/drush/drush-6.7.0-r4.ebuild | 68 ++++++++++++++++++
14 app-admin/drush/files/drush-6.7.0-gzip-mime.patch | 25 +++++++
15 app-admin/drush/files/drush-6.7.0-php8.0.patch | 87 +++++++++++++++++++++++
16 3 files changed, 180 insertions(+)
17
18 diff --git a/app-admin/drush/drush-6.7.0-r4.ebuild b/app-admin/drush/drush-6.7.0-r4.ebuild
19 new file mode 100644
20 index 000000000000..06b318dd0663
21 --- /dev/null
22 +++ b/app-admin/drush/drush-6.7.0-r4.ebuild
23 @@ -0,0 +1,68 @@
24 +# Copyright 1999-2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +inherit bash-completion-r1
30 +
31 +DESCRIPTION="Command line shell and scripting interface for Drupal"
32 +HOMEPAGE="https://github.com/drush-ops/drush"
33 +SRC_URI="https://github.com/drush-ops/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~x86"
38 +IUSE=""
39 +
40 +DEPEND=""
41 +RDEPEND="dev-lang/php[cli,ctype,json(+),simplexml]
42 + dev-php/PEAR-Console_Table"
43 +
44 +PATCHES=(
45 + "${FILESDIR}/update-bash-completion-script-for-2.1.patch"
46 + "${FILESDIR}/array-syntax.patch"
47 + "${FILESDIR}/${P}-php8.0.patch"
48 + "${FILESDIR}/${P}-gzip-mime.patch"
49 +)
50 +
51 +src_prepare() {
52 + default
53 +
54 + # dodoc compresses all of the documentation, so we fix the filenames
55 + # in a few places.
56 + #
57 + # First, the README location in bootstrap.inc.
58 + sed -i -e \
59 + "s!/share/doc/drush!/share/doc/${PF}!" \
60 + -e "s!README\.md!\0.bz2!g" \
61 + includes/bootstrap.inc || die
62 +
63 + # Next, the list of documentation in docs.drush.inc. Note that
64 + # html files don't get compressed.
65 + sed -i \
66 + -e "s!\.bashrc'!.bashrc.bz2'!" \
67 + -e "s!\.inc'!.inc.bz2'!" \
68 + -e "s!\.ini'!.ini.bz2'!" \
69 + -e "s!\.md'!.md.bz2'!" \
70 + -e "s!\.php'!.php.bz2'!" \
71 + -e "s!\.script'!.script.bz2'!" \
72 + -e "s!\.txt'!.txt.bz2'!" \
73 + commands/core/docs.drush.inc || die
74 +}
75 +
76 +src_install() {
77 + # Always install the examples; they're referenced within the source
78 + # code and too difficult to exorcise.
79 + dodoc -r README.md docs examples
80 +
81 + insinto /usr/share/drush
82 + doins -r classes commands includes lib misc
83 + doins drush_logo-black.png drush.info drush.php
84 +
85 + exeinto /usr/share/drush
86 + doexe drush
87 + dosym ../share/drush/drush /usr/bin/drush
88 +
89 + keepdir /etc/drush
90 + newbashcomp drush.complete.sh drush
91 +}
92
93 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
94 new file mode 100644
95 index 000000000000..53601c80fbda
96 --- /dev/null
97 +++ b/app-admin/drush/files/drush-6.7.0-gzip-mime.patch
98 @@ -0,0 +1,25 @@
99 +From 48a16a67ec072428339cc165743fedab6264edfe Mon Sep 17 00:00:00 2001
100 +From: Michael Orlitzky <michael@××××××××.com>
101 +Date: Mon, 26 Sep 2022 20:01:41 -0400
102 +Subject: [PATCH 1/4] includes/drush.inc: support application/gzip MIME type.
103 +
104 +This type is actually registered, as opposed to application/x-gzip.
105 +---
106 + includes/drush.inc | 1 +
107 + 1 file changed, 1 insertion(+)
108 +
109 +diff --git a/includes/drush.inc b/includes/drush.inc
110 +index f869b37..a748a0c 100644
111 +--- a/includes/drush.inc
112 ++++ b/includes/drush.inc
113 +@@ -930,6 +930,7 @@ function drush_file_is_tarball($path) {
114 + $content_type = drush_mime_content_type($path);
115 + $supported = array(
116 + 'application/x-bzip2',
117 ++ 'application/gzip',
118 + 'application/x-gzip',
119 + 'application/x-tar',
120 + 'application/x-zip',
121 +--
122 +2.35.1
123 +
124
125 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
126 new file mode 100644
127 index 000000000000..33a4ee7ba98b
128 --- /dev/null
129 +++ b/app-admin/drush/files/drush-6.7.0-php8.0.patch
130 @@ -0,0 +1,87 @@
131 +From 7be49f4d78111372fc58d91132daf6c4230b08ba Mon Sep 17 00:00:00 2001
132 +From: Michael Orlitzky <michael@××××××××.com>
133 +Date: Mon, 26 Sep 2022 19:08:09 -0400
134 +Subject: [PATCH 1/3] includes/drush.inc: replace create_function() with
135 + function(){...}
136 +
137 +---
138 + includes/drush.inc | 4 ++--
139 + 1 file changed, 2 insertions(+), 2 deletions(-)
140 +
141 +diff --git a/includes/drush.inc b/includes/drush.inc
142 +index a748a0c..7b8dda3 100644
143 +--- a/includes/drush.inc
144 ++++ b/includes/drush.inc
145 +@@ -987,9 +987,9 @@ function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE, $t
146 + // Remove the header line.
147 + array_shift($output);
148 + // Remove the prefix verb from each line.
149 +- $output = array_map(create_function('$str', 'return substr($str, strpos($str, ":") + 3 + ' . strlen($destination) . ');'), $output);
150 ++ $output = array_map(function($str){ return substr($str, strpos($str, ":") + 3 + strlen($destination)) ; }, $output);
151 + // Remove any remaining blank lines.
152 +- $return = array_filter($output, create_function('$str', 'return $str != "";'));
153 ++ $return = array_filter($output, function($str){return $str != "";});
154 + }
155 + }
156 + // Otherwise we have a possibly-compressed Tar file.
157 +--
158 +2.35.1
159 +
160 +From f118117814ef690ec71f484dc3c4906f82d9c726 Mon Sep 17 00:00:00 2001
161 +From: Michael Orlitzky <michael@××××××××.com>
162 +Date: Mon, 26 Sep 2022 19:32:13 -0400
163 +Subject: [PATCH 2/3] includes/backend.inc: replace usage of each().
164 +
165 +---
166 + includes/backend.inc | 4 ++--
167 + 1 file changed, 2 insertions(+), 2 deletions(-)
168 +
169 +diff --git a/includes/backend.inc b/includes/backend.inc
170 +index d004850..0ca010d 100644
171 +--- a/includes/backend.inc
172 ++++ b/includes/backend.inc
173 +@@ -355,8 +355,8 @@ function _drush_backend_proc_open($cmds, $process_limit, $context = NULL) {
174 + if (count($cmds) && (count($open_processes) < $process_limit)) {
175 + // Pop the site and command (key / value) from the cmds array
176 + end($cmds);
177 +- list($site, $cmd) = each($cmds);
178 +- unset($cmds[$site]);
179 ++ $site = key($cmds);
180 ++ $cmd = array_pop($cmds);
181 +
182 + if (is_array($cmd)) {
183 + $c = $cmd['cmd'];
184 +--
185 +2.35.1
186 +
187 +From 7d718639b68bd09c262005cff133d24ffdf800f1 Mon Sep 17 00:00:00 2001
188 +From: Michael Orlitzky <michael@××××××××.com>
189 +Date: Mon, 26 Sep 2022 19:36:29 -0400
190 +Subject: [PATCH 3/3] includes/environment.inc: default fifth parameter in
191 + error handler.
192 +
193 +The fifth parameter was removed in php-8.0:
194 +
195 + https://www.php.net/manual/en/function.set-error-handler.php
196 +
197 +We now default it to the empty array in drush_error_handler().
198 +---
199 + includes/environment.inc | 2 +-
200 + 1 file changed, 1 insertion(+), 1 deletion(-)
201 +
202 +diff --git a/includes/environment.inc b/includes/environment.inc
203 +index 7837104..8f2f414 100644
204 +--- a/includes/environment.inc
205 ++++ b/includes/environment.inc
206 +@@ -24,7 +24,7 @@ define('CONSOLE_TABLE_BASE_URL', 'https://github.com/RobLoach/Console_Table/arch
207 + * Log PHP errors to the Drush log. This is in effect until Drupal's error
208 + * handler takes over.
209 + */
210 +-function drush_error_handler($errno, $message, $filename, $line, $context) {
211 ++function drush_error_handler($errno, $message, $filename, $line, $context=[]) {
212 + // E_DEPRECATED was added in PHP 5.3. Drupal 6 will not fix all the
213 + // deprecated errors, but suppresses them. So we suppress them as well.
214 + if (defined('E_DEPRECATED')) {
215 +--
216 +2.35.1
217 +