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/, app-shells/bash/files/
Date: Sun, 04 Dec 2016 16:09:56
Message-Id: 1480867787.6a35e4b98136e1aee0565435a9a039ffcbb7b8ef.polynomial-c@gentoo
1 commit: 6a35e4b98136e1aee0565435a9a039ffcbb7b8ef
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 4 16:09:29 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 4 16:09:47 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a35e4b9
7
8 app-shells/bash: Removed old.
9
10 Package-Manager: portage-2.3.2
11
12 app-shells/bash/bash-4.3_p46-r1.ebuild | 254 ---------------------
13 .../bash/files/bash-4.3-prompt-string-comsub.patch | 118 ----------
14 2 files changed, 372 deletions(-)
15
16 diff --git a/app-shells/bash/bash-4.3_p46-r1.ebuild b/app-shells/bash/bash-4.3_p46-r1.ebuild
17 deleted file mode 100644
18 index 5234083..00000000
19 --- a/app-shells/bash/bash-4.3_p46-r1.ebuild
20 +++ /dev/null
21 @@ -1,254 +0,0 @@
22 -# Copyright 1999-2016 Gentoo Foundation
23 -# Distributed under the terms of the GNU General Public License v2
24 -# $Id$
25 -
26 -EAPI="5"
27 -
28 -inherit eutils flag-o-matic toolchain-funcs multilib
29 -
30 -# Official patchlevel
31 -# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
32 -PLEVEL=${PV##*_p}
33 -MY_PV=${PV/_p*}
34 -MY_PV=${MY_PV/_/-}
35 -MY_P=${PN}-${MY_PV}
36 -[[ ${PV} != *_p* ]] && PLEVEL=0
37 -patches() {
38 - local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
39 - [[ ${plevel} -eq 0 ]] && return 1
40 - eval set -- {1..${plevel}}
41 - set -- $(printf "${pn}${pv/\.}-%03d " "$@")
42 - if [[ ${opt} == -s ]] ; then
43 - echo "${@/#/${DISTDIR}/}"
44 - else
45 - local u
46 - for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
47 - printf "${u}/${pn}-${pv}-patches/%s " "$@"
48 - done
49 - fi
50 -}
51 -
52 -# The version of readline this bash normally ships with.
53 -READLINE_VER="6.3"
54 -
55 -DESCRIPTION="The standard GNU Bourne again shell"
56 -HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
57 -SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
58 -[[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
59 -
60 -LICENSE="GPL-3"
61 -SLOT="0"
62 -KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
63 -IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
64 -
65 -DEPEND=">=sys-libs/ncurses-5.2-r2:0=
66 - readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
67 - nls? ( virtual/libintl )"
68 -RDEPEND="${DEPEND}
69 - !<sys-apps/portage-2.1.6.7_p1
70 - !<sys-apps/paludis-0.26.0_alpha5"
71 -# we only need yacc when the .y files get patched (bash42-005)
72 -DEPEND+=" virtual/yacc"
73 -
74 -PATCHES=(
75 - "${FILESDIR}"/${PN}-4.3-mapfile-improper-array-name-validation.patch
76 - "${FILESDIR}"/${PN}-4.3-arrayfunc.patch
77 - "${FILESDIR}"/${PN}-4.3-protos.patch
78 - # CVE-2016-0634 / bug #594496
79 - "${FILESDIR}"/${PN}-4.3-prompt-string-comsub.patch
80 -)
81 -
82 -S=${WORKDIR}/${MY_P}
83 -
84 -pkg_setup() {
85 - if is-flag -malign-double ; then #7332
86 - eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
87 - eerror "as it breaks LFS (struct stat64) on x86."
88 - die "remove -malign-double from your CFLAGS mr ricer"
89 - fi
90 - if use bashlogger ; then
91 - ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
92 - ewarn "This will log ALL output you enter into the shell, you have been warned."
93 - fi
94 -}
95 -
96 -src_unpack() {
97 - unpack ${MY_P}.tar.gz
98 -}
99 -
100 -src_prepare() {
101 - # Include official patches
102 - [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
103 -
104 - # Clean out local libs so we know we use system ones w/releases.
105 - if [[ ${PV} != *_rc* ]] ; then
106 - rm -rf lib/{readline,termcap}/*
107 - touch lib/{readline,termcap}/Makefile.in # for config.status
108 - sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
109 - fi
110 -
111 - # Avoid regenerating docs after patches #407985
112 - sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
113 - touch -r . doc/*
114 -
115 - epatch "${PATCHES[@]}"
116 -
117 - epatch_user
118 -}
119 -
120 -src_configure() {
121 - local myconf=()
122 -
123 - # For descriptions of these, see config-top.h
124 - # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
125 - append-cppflags \
126 - -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
127 - -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
128 - -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
129 - -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
130 - -DNON_INTERACTIVE_LOGIN_SHELLS \
131 - -DSSH_SOURCE_BASHRC \
132 - -DUSE_MKTEMP -DUSE_MKSTEMP \
133 - $(use bashlogger && echo -DSYSLOG_HISTORY)
134 -
135 - # Don't even think about building this statically without
136 - # reading Bug 7714 first. If you still build it statically,
137 - # don't come crying to us with bugs ;).
138 - #use static && export LDFLAGS="${LDFLAGS} -static"
139 - use nls || myconf+=( --disable-nls )
140 -
141 - # Historically, we always used the builtin readline, but since
142 - # our handling of SONAME upgrades has gotten much more stable
143 - # in the PM (and the readline ebuild itself preserves the old
144 - # libs during upgrades), linking against the system copy should
145 - # be safe.
146 - # Exact cached version here doesn't really matter as long as it
147 - # is at least what's in the DEPEND up above.
148 - export ac_cv_rl_version=${READLINE_VER}
149 -
150 - # Force linking with system curses ... the bundled termcap lib
151 - # sucks bad compared to ncurses. For the most part, ncurses
152 - # is here because readline needs it. But bash itself calls
153 - # ncurses in one or two small places :(.
154 -
155 - if [[ ${PV} != *_rc* ]] ; then
156 - # Use system readline only with released versions.
157 - myconf+=( --with-installed-readline=. )
158 - fi
159 -
160 - if use plugins; then
161 - append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
162 - else
163 - # Disable the plugins logic by hand since bash doesn't
164 - # provide a way of doing it.
165 - export ac_cv_func_dl{close,open,sym}=no \
166 - ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
167 - sed -i \
168 - -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
169 - configure || die
170 - fi
171 - tc-export AR #444070
172 - econf \
173 - --docdir='$(datarootdir)'/doc/${PF} \
174 - --htmldir='$(docdir)/html' \
175 - --with-curses \
176 - $(use_with afs) \
177 - $(use_enable net net-redirections) \
178 - --disable-profiling \
179 - $(use_enable mem-scramble) \
180 - $(use_with mem-scramble bash-malloc) \
181 - $(use_enable readline) \
182 - $(use_enable readline history) \
183 - $(use_enable readline bang-history) \
184 - "${myconf[@]}"
185 -}
186 -
187 -src_compile() {
188 - emake
189 -
190 - if use plugins ; then
191 - emake -C examples/loadables all others
192 - fi
193 -}
194 -
195 -src_install() {
196 - local d f
197 -
198 - default
199 -
200 - dodir /bin
201 - mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
202 - dosym bash /bin/rbash
203 -
204 - insinto /etc/bash
205 - doins "${FILESDIR}"/bash_logout
206 - doins "${FILESDIR}"/bashrc
207 - keepdir /etc/bash/bashrc.d
208 - insinto /etc/skel
209 - for f in bash{_logout,_profile,rc} ; do
210 - newins "${FILESDIR}"/dot-${f} .${f}
211 - done
212 -
213 - local sed_args=(
214 - -e "s:#${USERLAND}#@::"
215 - -e '/#@/d'
216 - )
217 - if ! use readline ; then
218 - sed_args+=( #432338
219 - -e '/^shopt -s histappend/s:^:#:'
220 - -e 's:use_color=true:use_color=false:'
221 - )
222 - fi
223 - sed -i \
224 - "${sed_args[@]}" \
225 - "${ED}"/etc/skel/.bashrc \
226 - "${ED}"/etc/bash/bashrc || die
227 -
228 - if use plugins ; then
229 - exeinto /usr/$(get_libdir)/bash
230 - doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
231 - insinto /usr/include/bash-plugins
232 - doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
233 - fi
234 -
235 - if use examples ; then
236 - for d in examples/{functions,misc,scripts,startup-files} ; do
237 - exeinto /usr/share/doc/${PF}/${d}
238 - insinto /usr/share/doc/${PF}/${d}
239 - for f in ${d}/* ; do
240 - if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
241 - doexe ${f}
242 - else
243 - doins ${f}
244 - fi
245 - done
246 - done
247 - fi
248 -
249 - doman doc/*.1
250 - newdoc CWRU/changelog ChangeLog
251 - dosym bash.info /usr/share/info/bashref.info
252 -}
253 -
254 -pkg_preinst() {
255 - if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
256 - mkdir -p "${EROOT}"/etc/bash
257 - mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
258 - fi
259 -
260 - if [[ -L ${EROOT}/bin/sh ]] ; then
261 - # rewrite the symlink to ensure that its mtime changes. having /bin/sh
262 - # missing even temporarily causes a fatal error with paludis.
263 - local target=$(readlink "${EROOT}"/bin/sh)
264 - local tmp=$(emktemp "${EROOT}"/bin)
265 - ln -sf "${target}" "${tmp}"
266 - mv -f "${tmp}" "${EROOT}"/bin/sh
267 - fi
268 -}
269 -
270 -pkg_postinst() {
271 - # If /bin/sh does not exist, provide it
272 - if [[ ! -e ${EROOT}/bin/sh ]] ; then
273 - ln -sf bash "${EROOT}"/bin/sh
274 - fi
275 -}
276
277 diff --git a/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch b/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch
278 deleted file mode 100644
279 index 175bc53..00000000
280 --- a/app-shells/bash/files/bash-4.3-prompt-string-comsub.patch
281 +++ /dev/null
282 @@ -1,118 +0,0 @@
283 -http://seclists.org/oss-sec/2016/q3/538
284 -https://bugs.gentoo.org/594496
285 -
286 -*** ../bash-4.3-patched/parse.y 2015-08-13 15:11:54.000000000 -0400
287 ---- parse.y 2016-03-07 15:44:14.000000000 -0500
288 -***************
289 -*** 5259,5263 ****
290 - int result_size, result_index;
291 - int c, n, i;
292 -! char *temp, octal_string[4];
293 - struct tm *tm;
294 - time_t the_time;
295 ---- 5259,5263 ----
296 - int result_size, result_index;
297 - int c, n, i;
298 -! char *temp, *t_host, octal_string[4];
299 - struct tm *tm;
300 - time_t the_time;
301 -***************
302 -*** 5407,5411 ****
303 - case 's':
304 - temp = base_pathname (shell_name);
305 -! temp = savestring (temp);
306 - goto add_string;
307 -
308 ---- 5407,5415 ----
309 - case 's':
310 - temp = base_pathname (shell_name);
311 -! /* Try to quote anything the user can set in the file system */
312 -! if (promptvars || posixly_correct)
313 -! temp = sh_backslash_quote_for_double_quotes (temp);
314 -! else
315 -! temp = savestring (temp);
316 - goto add_string;
317 -
318 -***************
319 -*** 5497,5503 ****
320 - case 'h':
321 - case 'H':
322 -! temp = savestring (current_host_name);
323 -! if (c == 'h' && (t = (char *)strchr (temp, '.')))
324 - *t = '\0';
325 - goto add_string;
326 -
327 ---- 5501,5515 ----
328 - case 'h':
329 - case 'H':
330 -! t_host = savestring (current_host_name);
331 -! if (c == 'h' && (t = (char *)strchr (t_host, '.')))
332 - *t = '\0';
333 -+ if (promptvars || posixly_correct)
334 -+ /* Make sure that expand_prompt_string is called with a
335 -+ second argument of Q_DOUBLE_QUOTES if we use this
336 -+ function here. */
337 -+ temp = sh_backslash_quote_for_double_quotes (t_host);
338 -+ else
339 -+ temp = savestring (t_host);
340 -+ free (t_host);
341 - goto add_string;
342 -
343 -*** ../bash-4.3-patched/y.tab.c 2015-08-13 15:11:54.000000000 -0400
344 ---- y.tab.c 2016-03-07 15:44:14.000000000 -0500
345 -***************
346 -*** 7571,7575 ****
347 - int result_size, result_index;
348 - int c, n, i;
349 -! char *temp, octal_string[4];
350 - struct tm *tm;
351 - time_t the_time;
352 ---- 7571,7575 ----
353 - int result_size, result_index;
354 - int c, n, i;
355 -! char *temp, *t_host, octal_string[4];
356 - struct tm *tm;
357 - time_t the_time;
358 -***************
359 -*** 7719,7723 ****
360 - case 's':
361 - temp = base_pathname (shell_name);
362 -! temp = savestring (temp);
363 - goto add_string;
364 -
365 ---- 7719,7727 ----
366 - case 's':
367 - temp = base_pathname (shell_name);
368 -! /* Try to quote anything the user can set in the file system */
369 -! if (promptvars || posixly_correct)
370 -! temp = sh_backslash_quote_for_double_quotes (temp);
371 -! else
372 -! temp = savestring (temp);
373 - goto add_string;
374 -
375 -***************
376 -*** 7809,7815 ****
377 - case 'h':
378 - case 'H':
379 -! temp = savestring (current_host_name);
380 -! if (c == 'h' && (t = (char *)strchr (temp, '.')))
381 - *t = '\0';
382 - goto add_string;
383 -
384 ---- 7813,7827 ----
385 - case 'h':
386 - case 'H':
387 -! t_host = savestring (current_host_name);
388 -! if (c == 'h' && (t = (char *)strchr (t_host, '.')))
389 - *t = '\0';
390 -+ if (promptvars || posixly_correct)
391 -+ /* Make sure that expand_prompt_string is called with a
392 -+ second argument of Q_DOUBLE_QUOTES if we use this
393 -+ function here. */
394 -+ temp = sh_backslash_quote_for_double_quotes (t_host);
395 -+ else
396 -+ temp = savestring (t_host);
397 -+ free (t_host);
398 - goto add_string;
399 -
400 -