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, 23 Nov 2021 22:51:22
Message-Id: 1637707579.6c5283e1c0774fc35d1ad5dc0e8eb492a848f9c9.mjo@gentoo
1 commit: 6c5283e1c0774fc35d1ad5dc0e8eb492a848f9c9
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 23 22:46:06 2021 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 23 22:46:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c5283e1
7
8 app-admin/drush: new revision to silence deprecation warnings.
9
10 I'm still happily using this to update some drupal-7.x sites, but with
11 php-7.4, there are a few deprecation warnings that will later become
12 errors in php-8.0. The fixes are trivial, so I've added a small patch
13 to cure them.
14
15 Package-Manager: Portage-3.0.28, Repoman-3.0.3
16 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
17
18 app-admin/drush/drush-6.7.0-r3.ebuild | 66 ++++++++++++++++++++++++++++++++
19 app-admin/drush/files/array-syntax.patch | 58 ++++++++++++++++++++++++++++
20 2 files changed, 124 insertions(+)
21
22 diff --git a/app-admin/drush/drush-6.7.0-r3.ebuild b/app-admin/drush/drush-6.7.0-r3.ebuild
23 new file mode 100644
24 index 000000000000..38e4125922de
25 --- /dev/null
26 +++ b/app-admin/drush/drush-6.7.0-r3.ebuild
27 @@ -0,0 +1,66 @@
28 +# Copyright 1999-2021 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=8
32 +
33 +inherit bash-completion-r1
34 +
35 +DESCRIPTION="Command line shell and scripting interface for Drupal"
36 +HOMEPAGE="https://github.com/drush-ops/drush"
37 +SRC_URI="https://github.com/drush-ops/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +LICENSE="GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~x86"
42 +IUSE=""
43 +
44 +DEPEND=""
45 +RDEPEND="dev-lang/php[cli,ctype,json(+),simplexml]
46 + dev-php/PEAR-Console_Table"
47 +
48 +PATCHES=(
49 + "${FILESDIR}/update-bash-completion-script-for-2.1.patch"
50 + "${FILESDIR}/array-syntax.patch"
51 +)
52 +
53 +src_prepare() {
54 + default
55 +
56 + # dodoc compresses all of the documentation, so we fix the filenames
57 + # in a few places.
58 + #
59 + # First, the README location in bootstrap.inc.
60 + sed -i -e \
61 + "s!/share/doc/drush!/share/doc/${PF}!" \
62 + -e "s!README\.md!\0.bz2!g" \
63 + includes/bootstrap.inc || die
64 +
65 + # Next, the list of documentation in docs.drush.inc. Note that
66 + # html files don't get compressed.
67 + sed -i \
68 + -e "s!\.bashrc'!.bashrc.bz2'!" \
69 + -e "s!\.inc'!.inc.bz2'!" \
70 + -e "s!\.ini'!.ini.bz2'!" \
71 + -e "s!\.md'!.md.bz2'!" \
72 + -e "s!\.php'!.php.bz2'!" \
73 + -e "s!\.script'!.script.bz2'!" \
74 + -e "s!\.txt'!.txt.bz2'!" \
75 + commands/core/docs.drush.inc || die
76 +}
77 +
78 +src_install() {
79 + # Always install the examples; they're referenced within the source
80 + # code and too difficult to exorcise.
81 + dodoc -r README.md docs examples
82 +
83 + insinto /usr/share/drush
84 + doins -r classes commands includes lib misc
85 + doins drush_logo-black.png drush.info drush.php
86 +
87 + exeinto /usr/share/drush
88 + doexe drush
89 + dosym ../share/drush/drush /usr/bin/drush
90 +
91 + keepdir /etc/drush
92 + newbashcomp drush.complete.sh drush
93 +}
94
95 diff --git a/app-admin/drush/files/array-syntax.patch b/app-admin/drush/files/array-syntax.patch
96 new file mode 100644
97 index 000000000000..60abeea984e5
98 --- /dev/null
99 +++ b/app-admin/drush/files/array-syntax.patch
100 @@ -0,0 +1,58 @@
101 +From 354d3d4f7a0c56926bd5124d2ec5bb363a9f9bc8 Mon Sep 17 00:00:00 2001
102 +From: Michael Orlitzky <michael@××××××××.com>
103 +Date: Tue, 23 Nov 2021 17:34:24 -0500
104 +Subject: [PATCH 1/1] includes: don't access array elements with curly braces.
105 +
106 +The array{idx} syntax was deprecated in php-7.4 and has been removed
107 +in php-8.0. It's trivial to use square brackets, like array[idx],
108 +instead; so we do it.
109 +---
110 + includes/command.inc | 6 +++---
111 + includes/sitealias.inc | 6 +++---
112 + 2 files changed, 6 insertions(+), 6 deletions(-)
113 +
114 +diff --git a/includes/command.inc b/includes/command.inc
115 +index af039ad..ed0e817 100644
116 +--- a/includes/command.inc
117 ++++ b/includes/command.inc
118 +@@ -749,16 +749,16 @@ function drush_parse_args() {
119 + $command_args[] = $opt;
120 + }
121 + // Is the arg an option (starting with '-')?
122 +- if (!empty($opt) && $opt{0} == "-" && strlen($opt) != 1) {
123 ++ if (!empty($opt) && $opt[0] == "-" && strlen($opt) != 1) {
124 + // Do we have multiple options behind one '-'?
125 +- if (strlen($opt) > 2 && $opt{1} != "-") {
126 ++ if (strlen($opt) > 2 && $opt[1] != "-") {
127 + // Each char becomes a key of its own.
128 + for ($j = 1; $j < strlen($opt); $j++) {
129 + $options[substr($opt, $j, 1)] = true;
130 + }
131 + }
132 + // Do we have a longopt (starting with '--')?
133 +- elseif ($opt{1} == "-") {
134 ++ elseif ($opt[1] == "-") {
135 + if ($pos = strpos($opt, '=')) {
136 + $options[substr($opt, 2, $pos - 2)] = substr($opt, $pos + 1);
137 + }
138 +diff --git a/includes/sitealias.inc b/includes/sitealias.inc
139 +index b9f0bb9..13a38c1 100644
140 +--- a/includes/sitealias.inc
141 ++++ b/includes/sitealias.inc
142 +@@ -133,10 +133,10 @@ function drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_con
143 + function drush_sitealias_valid_alias_format($alias) {
144 + return ( (strpos($alias, ',') !== false) ||
145 + ((strpos($alias, '@') === FALSE ? 0 : 1) + (strpos($alias, '/') === FALSE ? 0 : 1) + (strpos($alias, '#') === FALSE ? 0 : 1) >= 2) ||
146 +- ($alias{0} == '#') ||
147 +- ($alias{0} == '@')
148 ++ ($alias[0] == '#') ||
149 ++ ($alias[0] == '@')
150 + );
151 +- return $alias{0} == '@';
152 ++ return $alias[0] == '@';
153 + }
154 +
155 + /**
156 +--
157 +2.32.0
158 +