From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2FF2E138334 for ; Wed, 20 Mar 2019 18:25:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5833CE08CD; Wed, 20 Mar 2019 18:25:19 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 15D84E08CD for ; Wed, 20 Mar 2019 18:25:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A26B8335D16 for ; Wed, 20 Mar 2019 18:25:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1AA394E3 for ; Wed, 20 Mar 2019 18:25:16 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1553106308.94f68f9a36e6771e06bc39ad0286121e8956121c.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-shells/bash/bash-5.0_p3-r1.ebuild app-shells/bash/files/bash-5.0-assignment-preceding-builtin.patch X-VCS-Directories: app-shells/bash/ app-shells/bash/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: 94f68f9a36e6771e06bc39ad0286121e8956121c X-VCS-Branch: master Date: Wed, 20 Mar 2019 18:25:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e1a89444-2c55-462d-9dbf-b8658cc727af X-Archives-Hash: 259e79c34a84d2a9ed615db351f49668 commit: 94f68f9a36e6771e06bc39ad0286121e8956121c Author: Lars Wendler gentoo org> AuthorDate: Wed Mar 20 18:24:48 2019 +0000 Commit: Lars Wendler gentoo org> CommitDate: Wed Mar 20 18:25:08 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94f68f9a app-shells/bash: Attempt to fix variable scoping in POSIX mode. Bug: https://bugs.gentoo.org/676344 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Lars Wendler gentoo.org> app-shells/bash/bash-5.0_p3-r1.ebuild | 267 +++++++++++++++++++++ .../bash-5.0-assignment-preceding-builtin.patch | 83 +++++++ 2 files changed, 350 insertions(+) diff --git a/app-shells/bash/bash-5.0_p3-r1.ebuild b/app-shells/bash/bash-5.0_p3-r1.ebuild new file mode 100644 index 00000000000..d13f22168a6 --- /dev/null +++ b/app-shells/bash/bash-5.0_p3-r1.ebuild @@ -0,0 +1,267 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic toolchain-funcs multilib prefix + +# Official patchlevel +# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/ +PLEVEL=${PV##*_p} +MY_PV=${PV/_p*} +MY_PV=${MY_PV/_/-} +MY_P=${PN}-${MY_PV} +is_release() { + case ${PV} in + *_alpha*|*_beta*|*_rc*) return 1 ;; + *) return 0 ;; + esac +} +[[ ${PV} != *_p* ]] && PLEVEL=0 +patches() { + local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} + [[ ${plevel} -eq 0 ]] && return 1 + eval set -- {1..${plevel}} + set -- $(printf "${pn}${pv/\.}-%03d " "$@") + if [[ ${opt} == -s ]] ; then + echo "${@/#/${DISTDIR}/}" + else + local u + for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do + printf "${u}/${pn}-${pv}-patches/%s " "$@" + done + fi +} + +# The version of readline this bash normally ships with. +READLINE_VER="8.0" + +DESCRIPTION="The standard GNU Bourne again shell" +HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" +if is_release ; then + SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" +else + SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" +fi + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~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" +IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline" + +DEPEND=" + >=sys-libs/ncurses-5.2-r2:0= + readline? ( >=sys-libs/readline-${READLINE_VER}:0= ) + nls? ( virtual/libintl ) +" +RDEPEND=" + ${DEPEND} + !name, value_cell (var), ASS_FORCE|ASS_NOLONGJMP); ++ ++ /* If this modifies an existing local variable, v->context will be non-zero. ++ If it comes back with v->context == 0, we bound at the global context. ++ Set binding_table appropriately. It doesn't matter whether it's correct ++ if the variable is local, only that it's not global_variables->table */ ++ binding_table = v->context ? shell_variables->table : global_variables->table; ++ #else + binding_table = global_variables->table; + if (binding_table == 0) +*************** +*** 4478,4486 **** + + v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, ASS_FORCE|ASS_NOLONGJMP); + + /* global variables are no longer temporary and don't need propagating. */ +! var->attributes &= ~(att_tempvar|att_propagate); + if (v) +! v->attributes |= var->attributes; + + if (find_special_var (var->name) >= 0) +--- 4491,4508 ---- + + v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, ASS_FORCE|ASS_NOLONGJMP); ++ #endif + + /* global variables are no longer temporary and don't need propagating. */ +! if (binding_table == global_variables->table) +! var->attributes &= ~(att_tempvar|att_propagate); +! + if (v) +! { +! v->attributes |= var->attributes; +! v->attributes &= ~att_tempvar; /* not a temp var now */ +! #if 0 /* TAG:bash-5.1 code doesn't need this, disable for bash-5.1 */ +! v->context = (binding_table == global_variables->table) ? 0 : shell_variables->scope; +! #endif +! } + + if (find_special_var (var->name) >= 0) +*************** +*** 4576,4587 **** + { + int i; + + tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1); + tempvar_list[tvlist_ind = 0] = 0; +! +! hash_flush (temporary_env, pushf); +! hash_dispose (temporary_env); + temporary_env = (HASH_TABLE *)NULL; + + tempvar_list[tvlist_ind] = 0; + +--- 4598,4612 ---- + { + int i; ++ HASH_TABLE *disposer; + + tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1); + tempvar_list[tvlist_ind = 0] = 0; +! +! disposer = temporary_env; + temporary_env = (HASH_TABLE *)NULL; + ++ hash_flush (disposer, pushf); ++ hash_dispose (disposer); ++ + tempvar_list[tvlist_ind] = 0; + +