Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/files/, app-shells/bash/
Date: Thu, 15 Aug 2019 10:50:23
Message-Id: 1565866200.62510d83798fcfa637ea4ca80fc9627005920e1f.polynomial-c@gentoo
1 commit: 62510d83798fcfa637ea4ca80fc9627005920e1f
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 15 10:50:00 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 15 10:50:00 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62510d83
7
8 app-shells/bash: Removed old.
9
10 Package-Manager: Portage-2.3.71, Repoman-2.3.17
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 app-shells/bash/bash-5.0_p3-r1.ebuild | 267 ---------------------
14 .../files/bash-5.0-optimize-connection-fork.patch | 79 ------
15 2 files changed, 346 deletions(-)
16
17 diff --git a/app-shells/bash/bash-5.0_p3-r1.ebuild b/app-shells/bash/bash-5.0_p3-r1.ebuild
18 deleted file mode 100644
19 index a13f1c8965c..00000000000
20 --- a/app-shells/bash/bash-5.0_p3-r1.ebuild
21 +++ /dev/null
22 @@ -1,267 +0,0 @@
23 -# Copyright 1999-2019 Gentoo Authors
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -EAPI=6
27 -
28 -inherit flag-o-matic toolchain-funcs multilib prefix
29 -
30 -# Official patchlevel
31 -# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
32 -PLEVEL=${PV##*_p}
33 -MY_PV=${PV/_p*}
34 -MY_PV=${MY_PV/_/-}
35 -MY_P=${PN}-${MY_PV}
36 -is_release() {
37 - case ${PV} in
38 - *_alpha*|*_beta*|*_rc*) return 1 ;;
39 - *) return 0 ;;
40 - esac
41 -}
42 -[[ ${PV} != *_p* ]] && PLEVEL=0
43 -patches() {
44 - local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
45 - [[ ${plevel} -eq 0 ]] && return 1
46 - eval set -- {1..${plevel}}
47 - set -- $(printf "${pn}${pv/\.}-%03d " "$@")
48 - if [[ ${opt} == -s ]] ; then
49 - echo "${@/#/${DISTDIR}/}"
50 - else
51 - local u
52 - for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
53 - printf "${u}/${pn}-${pv}-patches/%s " "$@"
54 - done
55 - fi
56 -}
57 -
58 -# The version of readline this bash normally ships with.
59 -READLINE_VER="8.0"
60 -
61 -DESCRIPTION="The standard GNU Bourne again shell"
62 -HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
63 -if is_release ; then
64 - SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
65 -else
66 - SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
67 -fi
68 -
69 -LICENSE="GPL-3"
70 -SLOT="0"
71 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
72 -IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
73 -
74 -DEPEND="
75 - >=sys-libs/ncurses-5.2-r2:0=
76 - readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
77 - nls? ( virtual/libintl )
78 -"
79 -RDEPEND="
80 - ${DEPEND}
81 - !<sys-apps/portage-2.1.6.7_p1
82 -"
83 -# we only need yacc when the .y files get patched (bash42-005)
84 -#DEPEND+=" virtual/yacc"
85 -
86 -S="${WORKDIR}/${MY_P}"
87 -
88 -PATCHES=(
89 - # Patches from Chet sent to bashbug ml
90 - "${FILESDIR}"/${PN}-5.0-history-zero-length.patch
91 - "${FILESDIR}"/${PN}-5.0-history-append.patch
92 - "${FILESDIR}"/${PN}-5.0-optimize-connection-fork.patch
93 - "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
94 - "${FILESDIR}"/${PN}-5.0-assignment-preceding-builtin.patch
95 -)
96 -
97 -pkg_setup() {
98 - if is-flag -malign-double ; then #7332
99 - eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
100 - eerror "as it breaks LFS (struct stat64) on x86."
101 - die "remove -malign-double from your CFLAGS mr ricer"
102 - fi
103 - if use bashlogger ; then
104 - ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
105 - ewarn "This will log ALL output you enter into the shell, you have been warned."
106 - fi
107 -}
108 -
109 -src_unpack() {
110 - unpack ${MY_P}.tar.gz
111 -}
112 -
113 -src_prepare() {
114 - # Include official patches
115 - [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
116 -
117 - # Clean out local libs so we know we use system ones w/releases.
118 - if is_release ; then
119 - rm -rf lib/{readline,termcap}/*
120 - touch lib/{readline,termcap}/Makefile.in # for config.status
121 - sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
122 - fi
123 -
124 - # Prefixify hardcoded path names. No-op for non-prefix.
125 - hprefixify pathnames.h.in
126 -
127 - # Avoid regenerating docs after patches #407985
128 - sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
129 - touch -r . doc/*
130 -
131 - eapply -p0 "${PATCHES[@]}"
132 - eapply_user
133 -}
134 -
135 -src_configure() {
136 - local myconf=(
137 - --disable-profiling
138 - --docdir='$(datarootdir)'/doc/${PF}
139 - --htmldir='$(docdir)/html'
140 - --with-curses
141 - $(use_enable mem-scramble)
142 - $(use_enable net net-redirections)
143 - $(use_enable readline)
144 - $(use_enable readline bang-history)
145 - $(use_enable readline history)
146 - $(use_with afs)
147 - $(use_with mem-scramble bash-malloc)
148 - )
149 -
150 - # For descriptions of these, see config-top.h
151 - # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
152 - append-cppflags \
153 - -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
154 - -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
155 - -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
156 - -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
157 - -DNON_INTERACTIVE_LOGIN_SHELLS \
158 - -DSSH_SOURCE_BASHRC \
159 - $(use bashlogger && echo -DSYSLOG_HISTORY)
160 -
161 - # Don't even think about building this statically without
162 - # reading Bug 7714 first. If you still build it statically,
163 - # don't come crying to us with bugs ;).
164 - #use static && export LDFLAGS="${LDFLAGS} -static"
165 - use nls || myconf+=( --disable-nls )
166 -
167 - # Historically, we always used the builtin readline, but since
168 - # our handling of SONAME upgrades has gotten much more stable
169 - # in the PM (and the readline ebuild itself preserves the old
170 - # libs during upgrades), linking against the system copy should
171 - # be safe.
172 - # Exact cached version here doesn't really matter as long as it
173 - # is at least what's in the DEPEND up above.
174 - export ac_cv_rl_version=${READLINE_VER%%_*}
175 -
176 - # Force linking with system curses ... the bundled termcap lib
177 - # sucks bad compared to ncurses. For the most part, ncurses
178 - # is here because readline needs it. But bash itself calls
179 - # ncurses in one or two small places :(.
180 -
181 - if is_release ; then
182 - # Use system readline only with released versions.
183 - myconf+=( --with-installed-readline=. )
184 - fi
185 -
186 - if use plugins; then
187 - append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
188 - else
189 - # Disable the plugins logic by hand since bash doesn't
190 - # provide a way of doing it.
191 - export ac_cv_func_dl{close,open,sym}=no \
192 - ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
193 - sed -i \
194 - -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
195 - configure || die
196 - fi
197 - tc-export AR #444070
198 - econf "${myconf[@]}"
199 -}
200 -
201 -src_compile() {
202 - emake
203 -
204 - if use plugins ; then
205 - emake -C examples/loadables all others
206 - fi
207 -}
208 -
209 -src_install() {
210 - local d f
211 -
212 - default
213 -
214 - dodir /bin
215 - mv "${ED%/}"/usr/bin/bash "${ED%/}"/bin/ || die
216 - dosym bash /bin/rbash
217 -
218 - insinto /etc/bash
219 - doins "${FILESDIR}"/bash_logout
220 - doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
221 - keepdir /etc/bash/bashrc.d
222 - insinto /etc/skel
223 - for f in bash{_logout,_profile,rc} ; do
224 - newins "${FILESDIR}"/dot-${f} .${f}
225 - done
226 -
227 - local sed_args=(
228 - -e "s:#${USERLAND}#@::"
229 - -e '/#@/d'
230 - )
231 - if ! use readline ; then
232 - sed_args+=( #432338
233 - -e '/^shopt -s histappend/s:^:#:'
234 - -e 's:use_color=true:use_color=false:'
235 - )
236 - fi
237 - sed -i \
238 - "${sed_args[@]}" \
239 - "${ED%/}"/etc/skel/.bashrc \
240 - "${ED%/}"/etc/bash/bashrc || die
241 -
242 - if use plugins ; then
243 - exeinto /usr/$(get_libdir)/bash
244 - doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
245 - insinto /usr/include/bash-plugins
246 - doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
247 - fi
248 -
249 - if use examples ; then
250 - for d in examples/{functions,misc,scripts,startup-files} ; do
251 - exeinto /usr/share/doc/${PF}/${d}
252 - insinto /usr/share/doc/${PF}/${d}
253 - for f in ${d}/* ; do
254 - if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
255 - doexe ${f}
256 - else
257 - doins ${f}
258 - fi
259 - done
260 - done
261 - fi
262 -
263 - doman doc/*.1
264 - newdoc CWRU/changelog ChangeLog
265 - dosym bash.info /usr/share/info/bashref.info
266 -}
267 -
268 -pkg_preinst() {
269 - if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
270 - mkdir -p "${EROOT}"/etc/bash
271 - mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
272 - fi
273 -
274 - if [[ -L ${EROOT}/bin/sh ]] ; then
275 - # rewrite the symlink to ensure that its mtime changes. having /bin/sh
276 - # missing even temporarily causes a fatal error with paludis.
277 - local target=$(readlink "${EROOT}"/bin/sh)
278 - local tmp=$(emktemp "${EROOT}"/bin)
279 - ln -sf "${target}" "${tmp}"
280 - mv -f "${tmp}" "${EROOT}"/bin/sh
281 - fi
282 -}
283 -
284 -pkg_postinst() {
285 - # If /bin/sh does not exist, provide it
286 - if [[ ! -e ${EROOT}/bin/sh ]] ; then
287 - ln -sf bash "${EROOT}"/bin/sh
288 - fi
289 -}
290
291 diff --git a/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch b/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch
292 deleted file mode 100644
293 index 3c6561bb126..00000000000
294 --- a/app-shells/bash/files/bash-5.0-optimize-connection-fork.patch
295 +++ /dev/null
296 @@ -1,79 +0,0 @@
297 -*** ../bash-5.0-patched/command.h 2018-07-20 21:16:31.000000000 -0400
298 ---- command.h 2019-02-20 11:09:36.000000000 -0500
299 -***************
300 -*** 187,190 ****
301 ---- 188,192 ----
302 - #define CMD_LASTPIPE 0x2000
303 - #define CMD_STDPATH 0x4000 /* use standard path for command lookup */
304 -+ #define CMD_TRY_OPTIMIZING 0x8000 /* try to optimize this simple command */
305 -
306 - /* What a command looks like. */
307 -*** ../bash-5.0-patched/builtins/evalstring.c 2018-12-26 11:19:21.000000000 -0500
308 ---- builtins/evalstring.c 2019-01-29 14:15:19.000000000 -0500
309 -***************
310 -*** 101,104 ****
311 ---- 101,113 ----
312 - }
313 -
314 -+ int
315 -+ can_optimize_connection (command)
316 -+ COMMAND *command;
317 -+ {
318 -+ return (*bash_input.location.string == '\0' &&
319 -+ (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
320 -+ command->value.Connection->second->type == cm_simple);
321 -+ }
322 -+
323 - void
324 - optimize_fork (command)
325 -***************
326 -*** 106,110 ****
327 - {
328 - if (command->type == cm_connection &&
329 -! (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR) &&
330 - should_suppress_fork (command->value.Connection->second))
331 - {
332 ---- 115,120 ----
333 - {
334 - if (command->type == cm_connection &&
335 -! (command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
336 -! (command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
337 - should_suppress_fork (command->value.Connection->second))
338 - {
339 -***************
340 -*** 413,418 ****
341 - command->value.Simple->flags |= CMD_NO_FORK;
342 - }
343 -! else if (command->type == cm_connection)
344 -! optimize_fork (command);
345 - #endif /* ONESHOT */
346 -
347 ---- 423,438 ----
348 - command->value.Simple->flags |= CMD_NO_FORK;
349 - }
350 -!
351 -! /* Can't optimize forks out here execept for simple commands.
352 -! This knows that the parser sets up commands as left-side heavy
353 -! (&& and || are left-associative) and after the single parse,
354 -! if we are at the end of the command string, the last in a
355 -! series of connection commands is
356 -! command->value.Connection->second. */
357 -! else if (command->type == cm_connection && can_optimize_connection (command))
358 -! {
359 -! command->value.Connection->second->flags |= CMD_TRY_OPTIMIZING;
360 -! command->value.Connection->second->value.Simple->flags |= CMD_TRY_OPTIMIZING;
361 -! }
362 - #endif /* ONESHOT */
363 -
364 -*** ../bash-5.0-patched/execute_cmd.c 2018-12-05 09:05:14.000000000 -0500
365 ---- execute_cmd.c 2019-01-25 15:59:00.000000000 -0500
366 -***************
367 -*** 2768,2771 ****
368 ---- 2768,2773 ----
369 - (exec_result != EXECUTION_SUCCESS)))
370 - {
371 -+ optimize_fork (command);
372 -+
373 - second = command->value.Connection->second;
374 - if (ignore_return && second)
375 -