1 |
commit: d3c19b7974aeb4ac2a1351a019e80625b4111c4b |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 26 22:31:37 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 26 22:44:14 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3c19b79 |
7 |
|
8 |
app-shells/bash: drop use of 'eval' for newer versions for patch generation |
9 |
|
10 |
Use similar approach as dev-libs/mpfr and sys-libs/readline |
11 |
for generating SRC_URI & patch list. |
12 |
|
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
...{bash-5.2_rc2.ebuild => bash-5.1_p16-r2.ebuild} | 149 +++++++++------------ |
16 |
app-shells/bash/bash-5.2_rc2.ebuild | 51 ++++--- |
17 |
app-shells/bash/bash-5.2_rc3.ebuild | 51 ++++--- |
18 |
app-shells/bash/bash-9999.ebuild | 51 ++++--- |
19 |
4 files changed, 157 insertions(+), 145 deletions(-) |
20 |
|
21 |
diff --git a/app-shells/bash/bash-5.2_rc2.ebuild b/app-shells/bash/bash-5.1_p16-r2.ebuild |
22 |
similarity index 66% |
23 |
copy from app-shells/bash/bash-5.2_rc2.ebuild |
24 |
copy to app-shells/bash/bash-5.1_p16-r2.ebuild |
25 |
index d451bde867f0..27cc205c5d91 100644 |
26 |
--- a/app-shells/bash/bash-5.2_rc2.ebuild |
27 |
+++ b/app-shells/bash/bash-5.1_p16-r2.ebuild |
28 |
@@ -3,16 +3,12 @@ |
29 |
|
30 |
EAPI=7 |
31 |
|
32 |
-# TODO on release: |
33 |
-# - check READLINE_VER, obviously |
34 |
-# (presumably there weren't always readline releases for bash RCs etc) |
35 |
- |
36 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc |
37 |
inherit flag-o-matic toolchain-funcs prefix verify-sig |
38 |
|
39 |
# Uncomment if we have a patchset |
40 |
-#GENTOO_PATCH_DEV="sam" |
41 |
-#GENTOO_PATCH_VER="${PV}" |
42 |
+GENTOO_PATCH_DEV="sam" |
43 |
+GENTOO_PATCH_VER="${PV}" |
44 |
|
45 |
# Official patchlevel |
46 |
# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/ |
47 |
@@ -20,85 +16,83 @@ PLEVEL="${PV##*_p}" |
48 |
MY_PV="${PV/_p*}" |
49 |
MY_PV="${MY_PV/_/-}" |
50 |
MY_P="${PN}-${MY_PV}" |
51 |
+MY_PATCHES=() |
52 |
+ |
53 |
is_release() { |
54 |
case ${PV} in |
55 |
- 9999|*_alpha*|*_beta*|*_rc*) return 1 ;; |
56 |
- *) return 0 ;; |
57 |
+ *_alpha*|*_beta*|*_rc*) |
58 |
+ return 1 |
59 |
+ ;; |
60 |
+ *) |
61 |
+ return 0 |
62 |
+ ;; |
63 |
esac |
64 |
} |
65 |
+ |
66 |
[[ ${PV} != *_p* ]] && PLEVEL=0 |
67 |
-patches() { |
68 |
- local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} |
69 |
- [[ ${plevel} -eq 0 ]] && return 1 |
70 |
- eval set -- {1..${plevel}} |
71 |
- set -- $(printf "${pn}${pv/\.}-%03d " "$@") |
72 |
- if [[ ${opt} == -s ]] ; then |
73 |
- echo "${@/#/${DISTDIR}/}" |
74 |
- else |
75 |
- local u |
76 |
- for u in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
77 |
- printf "${u}/${pn}-${pv}-patches/%s " "$@" |
78 |
- printf "${u}/${pn}-${pv}-patches/%s.asc " "$@" |
79 |
- done |
80 |
- fi |
81 |
-} |
82 |
|
83 |
# The version of readline this bash normally ships with. |
84 |
-# Note: right now, we don't use the system copy of readline for bash for non-releases. |
85 |
-READLINE_VER="8.2" |
86 |
+READLINE_VER="8.1" |
87 |
|
88 |
DESCRIPTION="The standard GNU Bourne again shell" |
89 |
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git" |
90 |
-if [[ ${PV} == 9999 ]] ; then |
91 |
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git" |
92 |
- EGIT_BRANCH=devel |
93 |
- inherit git-r3 |
94 |
-elif is_release ; then |
95 |
- SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" |
96 |
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html" |
97 |
+ |
98 |
+if is_release ; then |
99 |
+ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz" |
100 |
SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )" |
101 |
+ |
102 |
+ if [[ ${PLEVEL} -gt 0 ]] ; then |
103 |
+ # bash-5.1 -> bash51 |
104 |
+ my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) |
105 |
+ |
106 |
+ patch_url= |
107 |
+ my_patch_index= |
108 |
+ |
109 |
+ for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do |
110 |
+ for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
111 |
+ patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) |
112 |
+ SRC_URI+=" ${patch_url}" |
113 |
+ SRC_URI+=" verify-sig? ( ${patch_url}.sig )" |
114 |
+ |
115 |
+ done |
116 |
+ |
117 |
+ MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) |
118 |
+ done |
119 |
+ |
120 |
+ unset my_pn patch_url my_patch_index |
121 |
+ fi |
122 |
else |
123 |
- SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
124 |
- SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" |
125 |
+ SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
126 |
+ SRC_URI+=" verify-sig? ( ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" |
127 |
fi |
128 |
|
129 |
if [[ -n ${GENTOO_PATCH_VER} ]] ; then |
130 |
SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz" |
131 |
fi |
132 |
|
133 |
-LICENSE="GPL-3+" |
134 |
+LICENSE="GPL-3" |
135 |
SLOT="0" |
136 |
-if is_release ; then |
137 |
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
138 |
-fi |
139 |
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline" |
140 |
+[[ "${PV}" == *_rc* ]] || \ |
141 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
142 |
+IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline" |
143 |
|
144 |
DEPEND=" |
145 |
- >=sys-libs/ncurses-5.2-r2:= |
146 |
+ >=sys-libs/ncurses-5.2-r2:0= |
147 |
nls? ( virtual/libintl ) |
148 |
+ readline? ( >=sys-libs/readline-${READLINE_VER}:0= ) |
149 |
" |
150 |
-if is_release ; then |
151 |
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )" |
152 |
-fi |
153 |
RDEPEND=" |
154 |
${DEPEND} |
155 |
" |
156 |
# We only need yacc when the .y files get patched (bash42-005, bash51-011) |
157 |
-#BDEPEND="virtual/yacc" |
158 |
-BDEPEND=" |
159 |
- pgo? ( dev-util/gperf ) |
160 |
- verify-sig? ( sec-keys/openpgp-keys-chetramey ) |
161 |
-" |
162 |
+BDEPEND="virtual/yacc |
163 |
+ verify-sig? ( sec-keys/openpgp-keys-chetramey )" |
164 |
|
165 |
S="${WORKDIR}/${MY_P}" |
166 |
|
167 |
-# EAPI 8 tries to append it but it doesn't exist here |
168 |
-QA_CONFIGURE_OPTIONS="--disable-static" |
169 |
- |
170 |
PATCHES=( |
171 |
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/ |
172 |
- |
173 |
# Patches from Chet sent to bashbug ml |
174 |
- "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch |
175 |
+ "${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-5.0-syslog-history-extern.patch |
176 |
) |
177 |
|
178 |
pkg_setup() { |
179 |
@@ -133,7 +127,7 @@ src_unpack() { |
180 |
|
181 |
src_prepare() { |
182 |
# Include official patches |
183 |
- [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
184 |
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" |
185 |
|
186 |
# Clean out local libs so we know we use system ones w/releases. |
187 |
if is_release ; then |
188 |
@@ -189,16 +183,16 @@ src_configure() { |
189 |
#use static && export LDFLAGS="${LDFLAGS} -static" |
190 |
use nls || myconf+=( --disable-nls ) |
191 |
|
192 |
- if is_release ; then |
193 |
- # Historically, we always used the builtin readline, but since |
194 |
- # our handling of SONAME upgrades has gotten much more stable |
195 |
- # in the PM (and the readline ebuild itself preserves the old |
196 |
- # libs during upgrades), linking against the system copy should |
197 |
- # be safe. |
198 |
- # Exact cached version here doesn't really matter as long as it |
199 |
- # is at least what's in the DEPEND up above. |
200 |
- export ac_cv_rl_version=${READLINE_VER%%_*} |
201 |
+ # Historically, we always used the builtin readline, but since |
202 |
+ # our handling of SONAME upgrades has gotten much more stable |
203 |
+ # in the PM (and the readline ebuild itself preserves the old |
204 |
+ # libs during upgrades), linking against the system copy should |
205 |
+ # be safe. |
206 |
+ # Exact cached version here doesn't really matter as long as it |
207 |
+ # is at least what's in the DEPEND up above. |
208 |
+ export ac_cv_rl_version=${READLINE_VER%%_*} |
209 |
|
210 |
+ if is_release ; then |
211 |
# Use system readline only with released versions. |
212 |
myconf+=( --with-installed-readline=. ) |
213 |
fi |
214 |
@@ -223,34 +217,13 @@ src_configure() { |
215 |
} |
216 |
|
217 |
src_compile() { |
218 |
- if use pgo ; then |
219 |
- # Build Bash and run its tests to generate profiles. |
220 |
- emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" |
221 |
- |
222 |
- # Used in test suite. |
223 |
- unset A |
224 |
+ emake |
225 |
|
226 |
- emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check |
227 |
- |
228 |
- # Rebuild Bash using the profiling data we just generated. |
229 |
- emake clean |
230 |
- emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" |
231 |
- |
232 |
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others |
233 |
- else |
234 |
- emake |
235 |
- |
236 |
- use plugins && emake -C examples/loadables all others |
237 |
+ if use plugins ; then |
238 |
+ emake -C examples/loadables all others |
239 |
fi |
240 |
} |
241 |
|
242 |
-src_test() { |
243 |
- # Used in test suite. |
244 |
- unset A |
245 |
- |
246 |
- default |
247 |
-} |
248 |
- |
249 |
src_install() { |
250 |
local d f |
251 |
|
252 |
|
253 |
diff --git a/app-shells/bash/bash-5.2_rc2.ebuild b/app-shells/bash/bash-5.2_rc2.ebuild |
254 |
index d451bde867f0..847e52506d7f 100644 |
255 |
--- a/app-shells/bash/bash-5.2_rc2.ebuild |
256 |
+++ b/app-shells/bash/bash-5.2_rc2.ebuild |
257 |
@@ -20,28 +20,20 @@ PLEVEL="${PV##*_p}" |
258 |
MY_PV="${PV/_p*}" |
259 |
MY_PV="${MY_PV/_/-}" |
260 |
MY_P="${PN}-${MY_PV}" |
261 |
+MY_PATCHES=() |
262 |
+ |
263 |
is_release() { |
264 |
case ${PV} in |
265 |
- 9999|*_alpha*|*_beta*|*_rc*) return 1 ;; |
266 |
- *) return 0 ;; |
267 |
+ 9999|*_alpha*|*_beta*|*_rc*) |
268 |
+ return 1 |
269 |
+ ;; |
270 |
+ *) |
271 |
+ return 0 |
272 |
+ ;; |
273 |
esac |
274 |
} |
275 |
+ |
276 |
[[ ${PV} != *_p* ]] && PLEVEL=0 |
277 |
-patches() { |
278 |
- local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} |
279 |
- [[ ${plevel} -eq 0 ]] && return 1 |
280 |
- eval set -- {1..${plevel}} |
281 |
- set -- $(printf "${pn}${pv/\.}-%03d " "$@") |
282 |
- if [[ ${opt} == -s ]] ; then |
283 |
- echo "${@/#/${DISTDIR}/}" |
284 |
- else |
285 |
- local u |
286 |
- for u in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
287 |
- printf "${u}/${pn}-${pv}-patches/%s " "$@" |
288 |
- printf "${u}/${pn}-${pv}-patches/%s.asc " "$@" |
289 |
- done |
290 |
- fi |
291 |
-} |
292 |
|
293 |
# The version of readline this bash normally ships with. |
294 |
# Note: right now, we don't use the system copy of readline for bash for non-releases. |
295 |
@@ -49,13 +41,34 @@ READLINE_VER="8.2" |
296 |
|
297 |
DESCRIPTION="The standard GNU Bourne again shell" |
298 |
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git" |
299 |
+ |
300 |
if [[ ${PV} == 9999 ]] ; then |
301 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git" |
302 |
EGIT_BRANCH=devel |
303 |
inherit git-r3 |
304 |
elif is_release ; then |
305 |
- SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" |
306 |
+ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz" |
307 |
SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )" |
308 |
+ |
309 |
+ if [[ ${PLEVEL} -gt 0 ]] ; then |
310 |
+ # bash-5.1 -> bash51 |
311 |
+ my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) |
312 |
+ |
313 |
+ patch_url= |
314 |
+ my_patch_index= |
315 |
+ |
316 |
+ for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do |
317 |
+ for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
318 |
+ patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) |
319 |
+ SRC_URI+=" ${patch_url}" |
320 |
+ SRC_URI+=" verify-sig? ( ${patch_url}.sig )" |
321 |
+ done |
322 |
+ |
323 |
+ MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) |
324 |
+ done |
325 |
+ |
326 |
+ unset my_pn patch_url my_patch_index |
327 |
+ fi |
328 |
else |
329 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
330 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" |
331 |
@@ -133,7 +146,7 @@ src_unpack() { |
332 |
|
333 |
src_prepare() { |
334 |
# Include official patches |
335 |
- [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
336 |
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" |
337 |
|
338 |
# Clean out local libs so we know we use system ones w/releases. |
339 |
if is_release ; then |
340 |
|
341 |
diff --git a/app-shells/bash/bash-5.2_rc3.ebuild b/app-shells/bash/bash-5.2_rc3.ebuild |
342 |
index d451bde867f0..847e52506d7f 100644 |
343 |
--- a/app-shells/bash/bash-5.2_rc3.ebuild |
344 |
+++ b/app-shells/bash/bash-5.2_rc3.ebuild |
345 |
@@ -20,28 +20,20 @@ PLEVEL="${PV##*_p}" |
346 |
MY_PV="${PV/_p*}" |
347 |
MY_PV="${MY_PV/_/-}" |
348 |
MY_P="${PN}-${MY_PV}" |
349 |
+MY_PATCHES=() |
350 |
+ |
351 |
is_release() { |
352 |
case ${PV} in |
353 |
- 9999|*_alpha*|*_beta*|*_rc*) return 1 ;; |
354 |
- *) return 0 ;; |
355 |
+ 9999|*_alpha*|*_beta*|*_rc*) |
356 |
+ return 1 |
357 |
+ ;; |
358 |
+ *) |
359 |
+ return 0 |
360 |
+ ;; |
361 |
esac |
362 |
} |
363 |
+ |
364 |
[[ ${PV} != *_p* ]] && PLEVEL=0 |
365 |
-patches() { |
366 |
- local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} |
367 |
- [[ ${plevel} -eq 0 ]] && return 1 |
368 |
- eval set -- {1..${plevel}} |
369 |
- set -- $(printf "${pn}${pv/\.}-%03d " "$@") |
370 |
- if [[ ${opt} == -s ]] ; then |
371 |
- echo "${@/#/${DISTDIR}/}" |
372 |
- else |
373 |
- local u |
374 |
- for u in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
375 |
- printf "${u}/${pn}-${pv}-patches/%s " "$@" |
376 |
- printf "${u}/${pn}-${pv}-patches/%s.asc " "$@" |
377 |
- done |
378 |
- fi |
379 |
-} |
380 |
|
381 |
# The version of readline this bash normally ships with. |
382 |
# Note: right now, we don't use the system copy of readline for bash for non-releases. |
383 |
@@ -49,13 +41,34 @@ READLINE_VER="8.2" |
384 |
|
385 |
DESCRIPTION="The standard GNU Bourne again shell" |
386 |
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git" |
387 |
+ |
388 |
if [[ ${PV} == 9999 ]] ; then |
389 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git" |
390 |
EGIT_BRANCH=devel |
391 |
inherit git-r3 |
392 |
elif is_release ; then |
393 |
- SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" |
394 |
+ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz" |
395 |
SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )" |
396 |
+ |
397 |
+ if [[ ${PLEVEL} -gt 0 ]] ; then |
398 |
+ # bash-5.1 -> bash51 |
399 |
+ my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) |
400 |
+ |
401 |
+ patch_url= |
402 |
+ my_patch_index= |
403 |
+ |
404 |
+ for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do |
405 |
+ for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
406 |
+ patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) |
407 |
+ SRC_URI+=" ${patch_url}" |
408 |
+ SRC_URI+=" verify-sig? ( ${patch_url}.sig )" |
409 |
+ done |
410 |
+ |
411 |
+ MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) |
412 |
+ done |
413 |
+ |
414 |
+ unset my_pn patch_url my_patch_index |
415 |
+ fi |
416 |
else |
417 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
418 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" |
419 |
@@ -133,7 +146,7 @@ src_unpack() { |
420 |
|
421 |
src_prepare() { |
422 |
# Include official patches |
423 |
- [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
424 |
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" |
425 |
|
426 |
# Clean out local libs so we know we use system ones w/releases. |
427 |
if is_release ; then |
428 |
|
429 |
diff --git a/app-shells/bash/bash-9999.ebuild b/app-shells/bash/bash-9999.ebuild |
430 |
index d451bde867f0..847e52506d7f 100644 |
431 |
--- a/app-shells/bash/bash-9999.ebuild |
432 |
+++ b/app-shells/bash/bash-9999.ebuild |
433 |
@@ -20,28 +20,20 @@ PLEVEL="${PV##*_p}" |
434 |
MY_PV="${PV/_p*}" |
435 |
MY_PV="${MY_PV/_/-}" |
436 |
MY_P="${PN}-${MY_PV}" |
437 |
+MY_PATCHES=() |
438 |
+ |
439 |
is_release() { |
440 |
case ${PV} in |
441 |
- 9999|*_alpha*|*_beta*|*_rc*) return 1 ;; |
442 |
- *) return 0 ;; |
443 |
+ 9999|*_alpha*|*_beta*|*_rc*) |
444 |
+ return 1 |
445 |
+ ;; |
446 |
+ *) |
447 |
+ return 0 |
448 |
+ ;; |
449 |
esac |
450 |
} |
451 |
+ |
452 |
[[ ${PV} != *_p* ]] && PLEVEL=0 |
453 |
-patches() { |
454 |
- local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} |
455 |
- [[ ${plevel} -eq 0 ]] && return 1 |
456 |
- eval set -- {1..${plevel}} |
457 |
- set -- $(printf "${pn}${pv/\.}-%03d " "$@") |
458 |
- if [[ ${opt} == -s ]] ; then |
459 |
- echo "${@/#/${DISTDIR}/}" |
460 |
- else |
461 |
- local u |
462 |
- for u in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
463 |
- printf "${u}/${pn}-${pv}-patches/%s " "$@" |
464 |
- printf "${u}/${pn}-${pv}-patches/%s.asc " "$@" |
465 |
- done |
466 |
- fi |
467 |
-} |
468 |
|
469 |
# The version of readline this bash normally ships with. |
470 |
# Note: right now, we don't use the system copy of readline for bash for non-releases. |
471 |
@@ -49,13 +41,34 @@ READLINE_VER="8.2" |
472 |
|
473 |
DESCRIPTION="The standard GNU Bourne again shell" |
474 |
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git" |
475 |
+ |
476 |
if [[ ${PV} == 9999 ]] ; then |
477 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git" |
478 |
EGIT_BRANCH=devel |
479 |
inherit git-r3 |
480 |
elif is_release ; then |
481 |
- SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" |
482 |
+ SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz" |
483 |
SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )" |
484 |
+ |
485 |
+ if [[ ${PLEVEL} -gt 0 ]] ; then |
486 |
+ # bash-5.1 -> bash51 |
487 |
+ my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) |
488 |
+ |
489 |
+ patch_url= |
490 |
+ my_patch_index= |
491 |
+ |
492 |
+ for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do |
493 |
+ for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do |
494 |
+ patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) |
495 |
+ SRC_URI+=" ${patch_url}" |
496 |
+ SRC_URI+=" verify-sig? ( ${patch_url}.sig )" |
497 |
+ done |
498 |
+ |
499 |
+ MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) |
500 |
+ done |
501 |
+ |
502 |
+ unset my_pn patch_url my_patch_index |
503 |
+ fi |
504 |
else |
505 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" |
506 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" |
507 |
@@ -133,7 +146,7 @@ src_unpack() { |
508 |
|
509 |
src_prepare() { |
510 |
# Include official patches |
511 |
- [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s) |
512 |
+ [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" |
513 |
|
514 |
# Clean out local libs so we know we use system ones w/releases. |
515 |
if is_release ; then |