From 541eca7cf7b9950f0adaaf9158f94c76ba0aedc9 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 8 Oct 2022 19:30:29 +0100 Subject: gentoo auto-resync : 08:10:2022 - 19:30:29 --- app-shells/Manifest.gz | Bin 8794 -> 8795 bytes app-shells/bash/Manifest | 2 + app-shells/bash/bash-5.2_p2-r2.ebuild | 345 +++++++++++++++++++++ ...h-5.2_p2-fixes-for-extglob-in-compat-mode.patch | 320 +++++++++++++++++++ app-shells/ctypes-sh/Manifest | 2 +- app-shells/ctypes-sh/ctypes-sh-1.2-r1.ebuild | 37 --- app-shells/ctypes-sh/ctypes-sh-1.2-r2.ebuild | 37 +++ 7 files changed, 705 insertions(+), 38 deletions(-) create mode 100644 app-shells/bash/bash-5.2_p2-r2.ebuild create mode 100644 app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch delete mode 100644 app-shells/ctypes-sh/ctypes-sh-1.2-r1.ebuild create mode 100644 app-shells/ctypes-sh/ctypes-sh-1.2-r2.ebuild (limited to 'app-shells') diff --git a/app-shells/Manifest.gz b/app-shells/Manifest.gz index d376e584b49d..7dbab82d9da1 100644 Binary files a/app-shells/Manifest.gz and b/app-shells/Manifest.gz differ diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest index 29471678f742..3b78da93648a 100644 --- a/app-shells/bash/Manifest +++ b/app-shells/bash/Manifest @@ -1,4 +1,5 @@ AUX bash-5.0-syslog-history-extern.patch 376 BLAKE2B d883d3c3adbf8f4d19ecc3c2790754a7f6972682d1679b07d5bc599bdbfc019ba8ad4d1271ec550b59447db0a02f1219c9e6057a0b1c1c6c52f7750a746a07bf SHA512 c8dd17bdd8ccbd73061a7cbcb7351195e703a2c5fc6faf288ec3721fc6e526d88dd4b2201f87078a92ca134b98214ccfa935f82f585322f72e9a41fd51842b6a +AUX bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch 9443 BLAKE2B a001c90dc2f9376e4c828d4ebbb7bad1752b22f49a4b6050a54859734d9b444616480e29bcb7b140cd3e72b56e71e911d7a48e879a8eda71b7e750401bcbf885 SHA512 ef6863afa206edbc0711a3867902a50907285ce85534a96f87ff44cba9267067bfe25870c132a801f19a12e8cf0454e6c54f0d14d3bea1090415c8c0e97bd1a6 AUX bash_logout 205 BLAKE2B b8c0266c3d1e31a714304a2b3b33389f042ae5bd497379f9b15ce31d47d1e3da73ba6536023953b00efe27b687e2ff45d94e3f01a13acc824dc12e31552c5b94 SHA512 7234250c03fc920996a381f9daef9e2d8ab1e1a29acdebed6669d8e0fe1c872a7fa343adf7d9ddc81225b0cd9eb223ba7ad1ff42448aff057fc6d6baa8f04a7d AUX bashrc 3496 BLAKE2B eced5328d6ff2545c4e088ec5050ccd72fb5344bb83bd7d70b95840e68e642bd2a302c393b2ad12bd1ee9f42d51334043f8c1a0d36274bfd365339cec33cdec0 SHA512 39472c63db1f69cca8a92c5d330695f29e8f0b0524a6319482bbec394d91503d7c3a69dcd961927c7c404490efc8cf41b381e7bf4134098b750f47e5a47ff393 AUX dot-bash_logout 127 BLAKE2B 8290778aea3426f4c56e5a9e7328faa76f99001fc7ce3eeb3ec26624edcd918d7e946da9a63ffcd0cf0f739b528ccb9e764d448276fe4344b69ef2036fdd9921 SHA512 e0248b5087656a4dd3a4790ed8e6101866b922ccab36b510b3bf408dc0c583e70f323fbad0392e4ea6ca5dcbe73568733e0c0aa9c8ce6b00ff5f72bf3e9fd8fd @@ -395,6 +396,7 @@ EBUILD bash-4.4_p23-r2.ebuild 6090 BLAKE2B d09c2e76a0766ec38ace27c76b5219a52a6fa EBUILD bash-5.0_p18.ebuild 7423 BLAKE2B ca28a57b4407a5971bdf25f477e4c6b40b6c2b1f79aaffaf778838f41490dcf7da7eb7dbe4652b47164210c25e764751f8ec60d4dc1c30751373bc0636d9d3ea SHA512 bddcc1a7813ed881f8ba6bf440a890f5ac633335e743ea1393082a6a55d99a3604b36271c6f15c9e2a7b06eefac1820f8f6ee4f92f582afc9ea86181c43ace6b EBUILD bash-5.1_p16-r1.ebuild 8047 BLAKE2B 920477ad40a57b693a034c2a526b9769e90d6a8c71a7e956551f198e4cb84605abe32e580df99f78340c183e85590640f213b76a437b825d7710b5c5d755a493 SHA512 d3dba26ef514f9dd93c9743d73dd5ea6041e006bc3f4e5d330898f4579267d08d87cdd0634de57e7f740d065e6f4e518119c141447f691679a0b4a3df7a0a147 EBUILD bash-5.1_p16-r2.ebuild 8234 BLAKE2B f5b26b6ad263cd92f91f8c6fe0896b90cb43bb5faa4b92c80e123ec3fa74316f43e441fd50a54d47257fc3e4baec625a4274e5ec58b125a9e899d21c1be6263a SHA512 c848cfea6401643d2517cc18a6018f206e384264728dcc040aa8d5d22ec901c37f0e8a49758933b794d6381770f4549ad4d6fd3521f6db14f91c1798895b03d0 +EBUILD bash-5.2_p2-r2.ebuild 9411 BLAKE2B 4021d36bb01703db4f7f5982d8856bf4da42bdeb2a79ba3a992f904a3becad82e1499cc3c3d19a5e8ffa5ad5052d78960bcff7c14db4ddd522553559909bb818 SHA512 58b49fcf1029e701475700b65061d4531a4ee9d5647ea90085f4cf29efb768061e2e7bb40dcc511a3e48aa02f3676e8f52b665bb76e6d6cb3daec4b00a177eb5 EBUILD bash-5.2_p2.ebuild 9350 BLAKE2B e1e028bcef06fbbadaa200376a7d33bd2fa2b1c4ce5a5711805ea9b7bf3426a4785b147cc9cb1a8f2314b004ecef0d95c0b212a935946225b11e9334031e55eb SHA512 deced834f4d2cf6ed25405b45018fbd20e9da7cf2e64bba75979a19e8c13fe6404569a58555a233cdcd4dafa039b8f2bde89e014c0b12194e6c1c326ee0dfb8b EBUILD bash-9999.ebuild 9350 BLAKE2B e1e028bcef06fbbadaa200376a7d33bd2fa2b1c4ce5a5711805ea9b7bf3426a4785b147cc9cb1a8f2314b004ecef0d95c0b212a935946225b11e9334031e55eb SHA512 deced834f4d2cf6ed25405b45018fbd20e9da7cf2e64bba75979a19e8c13fe6404569a58555a233cdcd4dafa039b8f2bde89e014c0b12194e6c1c326ee0dfb8b MISC metadata.xml 963 BLAKE2B cadf4453d8e9f77353fcae360e6d2b0a254303ba4ee422bd799be1d44733ca2833c1a2cf21c0ce30fdca365e70f0bb295f946669483c1d284ffa89fbffdf6a50 SHA512 51079c00a5d93eed4169a69fdae98c292df842de195bb8880319a582bf37ed1d1574ae57805ccf57baf0880391871c07b794487806257da3eab19744d8090e35 diff --git a/app-shells/bash/bash-5.2_p2-r2.ebuild b/app-shells/bash/bash-5.2_p2-r2.ebuild new file mode 100644 index 000000000000..897cf5324a38 --- /dev/null +++ b/app-shells/bash/bash-5.2_p2-r2.ebuild @@ -0,0 +1,345 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc +inherit flag-o-matic toolchain-funcs prefix verify-sig + +# Uncomment if we have a patchset +#GENTOO_PATCH_DEV="sam" +#GENTOO_PATCH_VER="${PV}" + +# Official patchlevel +# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/ +PLEVEL="${PV##*_p}" +MY_PV="${PV/_p*}" +MY_PV="${MY_PV/_/-}" +MY_P="${PN}-${MY_PV}" +MY_PATCHES=() + +is_release() { + case ${PV} in + 9999|*_alpha*|*_beta*|*_rc*) + return 1 + ;; + *) + return 0 + ;; + esac +} + +[[ ${PV} != *_p* ]] && PLEVEL=0 + +# The version of readline this bash normally ships with. +# Note: right now, we don't use the system copy of readline for bash for non-releases. +READLINE_VER="8.2_p1" + +DESCRIPTION="The standard GNU Bourne again shell" +HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git" + EGIT_BRANCH=devel + inherit git-r3 +elif is_release ; then + SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz" + SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )" + + if [[ ${PLEVEL} -gt 0 ]] ; then + # bash-5.1 -> bash51 + my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2)) + + patch_url= + my_patch_index= + + for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do + for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do + patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index}) + SRC_URI+=" ${patch_url}" + SRC_URI+=" verify-sig? ( ${patch_url}.sig )" + done + + MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) ) + done + + unset my_pn patch_url my_patch_index + fi +else + SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" + SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )" +fi + +if [[ -n ${GENTOO_PATCH_VER} ]] ; then + SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz" +fi + +LICENSE="GPL-3+" +SLOT="0" +if is_release ; then + 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" +fi +IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline" + +DEPEND=" + >=sys-libs/ncurses-5.2-r2:= + nls? ( virtual/libintl ) +" +if is_release ; then + DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )" +fi +RDEPEND=" + ${DEPEND} +" +# We only need yacc when the .y files get patched (bash42-005, bash51-011) +BDEPEND=" + virtual/yacc + pgo? ( dev-util/gperf ) + verify-sig? ( sec-keys/openpgp-keys-chetramey ) +" + +S="${WORKDIR}/${MY_P}" + +# EAPI 8 tries to append it but it doesn't exist here +QA_CONFIGURE_OPTIONS="--disable-static" + +PATCHES=( + #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/ + + # Patches from Chet sent to bash-bug ml + "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch + "${FILESDIR}"/${PN}-5.2_p2-fixes-for-extglob-in-compat-mode.patch +) + +pkg_setup() { + # bug #7332 + if is-flag -malign-double ; then + eerror "Detected bad CFLAGS '-malign-double'. Do not use this" + eerror "as it breaks LFS (struct stat64) on x86." + die "remove -malign-double from your CFLAGS mr ricer" + fi + + if use bashlogger ; then + ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs." + ewarn "This will log ALL output you enter into the shell, you have been warned." + fi +} + +src_unpack() { + if [[ ${PV} == 9999 ]] ; then + git-r3_src_unpack + else + if use verify-sig ; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig} + fi + + unpack ${MY_P}.tar.gz + + if [[ -n ${GENTOO_PATCH_VER} ]] ; then + unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz + fi + fi +} + +src_prepare() { + # Include official patches + [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}" + + # Clean out local libs so we know we use system ones w/releases. + if is_release ; then + rm -rf lib/{readline,termcap}/* || die + touch lib/{readline,termcap}/Makefile.in || die # for config.status + sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die + fi + + # Prefixify hardcoded path names. No-op for non-prefix. + hprefixify pathnames.h.in + + # Avoid regenerating docs after patches, bug #407985 + sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die + touch -r . doc/* || die + + eapply -p0 "${PATCHES[@]}" + eapply_user +} + +src_configure() { + local myconf=( + --disable-profiling + + # Force linking with system curses ... the bundled termcap lib + # sucks bad compared to ncurses. For the most part, ncurses + # is here because readline needs it. But bash itself calls + # ncurses in one or two small places :(. + --with-curses + + $(use_enable mem-scramble) + $(use_enable net net-redirections) + $(use_enable readline) + $(use_enable readline bang-history) + $(use_enable readline history) + $(use_with afs) + $(use_with mem-scramble bash-malloc) + ) + + # For descriptions of these, see config-top.h + # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426 + append-cppflags \ + -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \ + -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \ + -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \ + -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \ + -DNON_INTERACTIVE_LOGIN_SHELLS \ + -DSSH_SOURCE_BASHRC \ + $(use bashlogger && echo -DSYSLOG_HISTORY) + + # Don't even think about building this statically without + # reading bug #7714 first. If you still build it statically, + # don't come crying to us with bugs ;). + #use static && export LDFLAGS="${LDFLAGS} -static" + use nls || myconf+=( --disable-nls ) + + if is_release ; then + # Historically, we always used the builtin readline, but since + # our handling of SONAME upgrades has gotten much more stable + # in the PM (and the readline ebuild itself preserves the old + # libs during upgrades), linking against the system copy should + # be safe. + # Exact cached version here doesn't really matter as long as it + # is at least what's in the DEPEND up above. + export ac_cv_rl_version=${READLINE_VER%%_*} + + # Use system readline only with released versions. + myconf+=( --with-installed-readline=. ) + fi + + if use plugins ; then + append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash + else + # Disable the plugins logic by hand since bash doesn't + # provide a way of doing it. + export ac_cv_func_dl{close,open,sym}=no \ + ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no + + sed -i \ + -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \ + configure || die + fi + + # bug #444070 + tc-export AR + + econf "${myconf[@]}" +} + +src_compile() { + if use pgo ; then + # Build Bash and run its tests to generate profiles. + emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" + + # Used in test suite. + unset A + + emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check + + # Rebuild Bash using the profiling data we just generated. + emake clean + emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" + + use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others + else + emake + + use plugins && emake -C examples/loadables all others + fi +} + +src_test() { + # Used in test suite. + unset A + + default +} + +src_install() { + local d f + + default + + dodir /bin + mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die + dosym bash /bin/rbash + + insinto /etc/bash + doins "${FILESDIR}"/bash_logout + doins "$(prefixify_ro "${FILESDIR}"/bashrc)" + + keepdir /etc/bash/bashrc.d + + insinto /etc/skel + for f in bash{_logout,_profile,rc} ; do + newins "${FILESDIR}"/dot-${f} .${f} + done + + local sed_args=( + -e "s:#${USERLAND}#@::" + -e '/#@/d' + ) + + if ! use readline ; then + # bug #432338 + sed_args+=( + -e '/^shopt -s histappend/s:^:#:' + -e 's:use_color=true:use_color=false:' + ) + fi + + sed -i \ + "${sed_args[@]}" \ + "${ED}"/etc/skel/.bashrc \ + "${ED}"/etc/bash/bashrc || die + + if use plugins ; then + exeinto /usr/$(get_libdir)/bash + doexe $(echo examples/loadables/*.o | sed 's:\.o::g') + + insinto /usr/include/bash-plugins + doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h} + fi + + if use examples ; then + for d in examples/{functions,misc,scripts,startup-files} ; do + exeinto /usr/share/doc/${PF}/${d} + docinto ${d} + for f in ${d}/* ; do + if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then + doexe ${f} + else + dodoc ${f} + fi + done + done + fi + + # Install bash_builtins.1 and rbash.1 + emake -C doc DESTDIR="${D}" install_builtins + sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die + doman "${T}"/rbash.1 + + newdoc CWRU/changelog ChangeLog + dosym bash.info /usr/share/info/bashref.info +} + +pkg_preinst() { + if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then + mkdir -p "${EROOT}"/etc/bash + mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ + fi +} + +pkg_postinst() { + # If /bin/sh does not exist, provide it + if [[ ! -e ${EROOT}/bin/sh ]] ; then + ln -sf bash "${EROOT}"/bin/sh + fi +} diff --git a/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch new file mode 100644 index 000000000000..06415b5cdaa4 --- /dev/null +++ b/app-shells/bash/files/bash-5.2_p2-fixes-for-extglob-in-compat-mode.patch @@ -0,0 +1,320 @@ +https://bugs.gentoo.org/873931 +https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00001.html +https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=22f21b760ed90eb77c3756e6ccf39b73c84f532a + +--- MANIFEST ++++ MANIFEST +@@ -1131,6 +1131,7 @@ tests/extglob4.sub f + tests/extglob5.sub f + tests/extglob6.sub f + tests/extglob7.sub f ++tests/extglob8.sub f + tests/func.tests f + tests/func.right f + tests/func1.sub f +--- builtins/common.h ++++ builtins/common.h +@@ -257,6 +257,10 @@ extern int print_shift_error; + extern int expand_once_flag; + #endif + ++#if defined (EXTENDED_GLOB) ++extern int extglob_flag; ++#endif ++ + /* variables from source.def */ + extern int source_searches_cwd; + extern int source_uses_path; +--- builtins/shopt.def ++++ builtins/shopt.def +@@ -1,7 +1,7 @@ + This file is shopt.def, from which is created shopt.c. + It implements the Bash `shopt' builtin. + +-Copyright (C) 1994-2021 Free Software Foundation, Inc. ++Copyright (C) 1994-2022 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + +@@ -149,6 +149,11 @@ static int shopt_set_complete_direxpand PARAMS((char *, int)); + static int set_assoc_expand PARAMS((char *, int)); + #endif + ++#if defined (EXTENDED_GLOB) ++int extglob_flag = EXTGLOB_DEFAULT; ++static int shopt_set_extglob PARAMS((char *, int)); ++#endif ++ + static int shopt_set_debug_mode PARAMS((char *, int)); + + static int shopt_login_shell; +@@ -203,7 +208,7 @@ static struct { + { "extdebug", &debugging_mode, shopt_set_debug_mode }, + #endif + #if defined (EXTENDED_GLOB) +- { "extglob", &extended_glob, (shopt_set_func_t *)NULL }, ++ { "extglob", &extglob_flag, shopt_set_extglob }, + #endif + { "extquote", &extended_quote, (shopt_set_func_t *)NULL }, + { "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL }, +@@ -374,7 +379,7 @@ reset_shopt_options () + #endif + + #if defined (EXTENDED_GLOB) +- extended_glob = EXTGLOB_DEFAULT; ++ extended_glob = extglob_flag = EXTGLOB_DEFAULT; + #endif + + #if defined (ARRAY_VARS) +@@ -631,11 +636,24 @@ shopt_set_debug_mode (option_name, mode) + return (0); + } + ++#if defined (EXTENDED_GLOB) ++static int ++shopt_set_extglob (option_name, mode) ++ char *option_name; ++ int mode; ++{ ++ extended_glob = extglob_flag; ++ return 0; ++} ++#endif ++ + #if defined (READLINE) + static int + shopt_enable_hostname_completion (option_name, mode) + char *option_name; + int mode; ++ ++ + { + return (enable_hostname_completion (mode)); + } +--- execute_cmd.c ++++ execute_cmd.c +@@ -3990,13 +3990,11 @@ execute_cond_node (cond) + else + #endif /* COND_REGEXP */ + { +- int oe; +- oe = extended_glob; + extended_glob = 1; + result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE) + ? EXECUTION_SUCCESS + : EXECUTION_FAILURE; +- extended_glob = oe; ++ extended_glob = extglob_flag; + } + if (arg1 != nullstr) + free (arg1); +--- parse.y ++++ parse.y +@@ -125,7 +125,7 @@ do { \ + } while (0) + + #if defined (EXTENDED_GLOB) +-extern int extended_glob; ++extern int extended_glob, extglob_flag; + #endif + + #if defined (TRANSLATABLE_STRINGS) +@@ -312,8 +312,6 @@ static int token_before_that; + /* The token read prior to token_before_that. */ + static int two_tokens_ago; + +-static int global_extglob; +- + /* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +@@ -3304,7 +3302,7 @@ reset_parser () + #if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & (PST_EXTPAT|PST_CMDSUBST)) +- extended_glob = global_extglob; ++ extended_glob = extglob_flag; + #endif + + parser_state = 0; +@@ -4118,10 +4116,10 @@ parse_comsub (qc, open, close, lenp, flags) + expand_aliases = posixly_correct != 0; + #if defined (EXTENDED_GLOB) + /* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a +- conditional command and have already set global_extglob appropriately. */ ++ conditional command and have already set extended_glob appropriately. */ + if (shell_compatibility_level <= 51 && was_extpat == 0) + { +- local_extglob = global_extglob = extended_glob; ++ local_extglob = extended_glob; + extended_glob = 1; + } + #endif +@@ -4229,7 +4227,7 @@ xparse_dolparen (base, string, indp, flags) + { + sh_parser_state_t ps; + sh_input_line_state_t ls; +- int orig_ind, nc, sflags, start_lineno; ++ int orig_ind, nc, sflags, start_lineno, local_extglob; + char *ret, *ep, *ostring; + + /*debug_parser(1);*/ +@@ -4272,7 +4270,7 @@ xparse_dolparen (base, string, indp, flags) + old value will be restored by restore_parser_state(). */ + expand_aliases = 0; + #if defined (EXTENDED_GLOB) +- global_extglob = extended_glob; /* for reset_parser() */ ++ local_extglob = extended_glob; + #endif + + token_to_read = DOLPAREN; /* let's trick the parser */ +@@ -4290,6 +4288,9 @@ xparse_dolparen (base, string, indp, flags) + restore_input_line_state (&ls); + restore_parser_state (&ps); + ++#if defined (EXTENDED_GLOB) ++ extended_glob = local_extglob; ++#endif + token_to_read = 0; + + /* If parse_string returns < 0, we need to jump to top level with the +@@ -4724,12 +4725,16 @@ cond_term () + } + + /* rhs */ ++#if defined (EXTENDED_GLOB) + local_extglob = extended_glob; + if (parser_state & PST_EXTPAT) + extended_glob = 1; ++#endif + tok = read_token (READ); ++#if defined (EXTENDED_GLOB) + if (parser_state & PST_EXTPAT) + extended_glob = local_extglob; ++#endif + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) +@@ -4776,7 +4781,6 @@ parse_cond_command () + { + COND_COM *cexp; + +- global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); + } +--- patchlevel.h ++++ patchlevel.h +@@ -1,6 +1,6 @@ + /* patchlevel.h -- current bash patch level */ + +-/* Copyright (C) 2001-2021 Free Software Foundation, Inc. ++/* Copyright (C) 2001-2022 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + +--- subst.c ++++ subst.c +@@ -1798,6 +1798,9 @@ extract_heredoc_dolbrace_string (string, sindex, quoted, flags) + return (result); + } + ++#define PARAMEXPNEST_MAX 32 // for now ++static int dbstate[PARAMEXPNEST_MAX]; ++ + /* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. +@@ -1828,6 +1831,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags) + if (quoted == Q_HERE_DOCUMENT && dolbrace_state == DOLBRACE_QUOTE && (flags & SX_NOALLOC) == 0) + return (extract_heredoc_dolbrace_string (string, sindex, quoted, flags)); + ++ dbstate[0] = dolbrace_state; ++ + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; +@@ -1852,6 +1857,8 @@ extract_dollar_brace_string (string, sindex, quoted, flags) + + if (string[i] == '$' && string[i+1] == LBRACE) + { ++ if (nesting_level < PARAMEXPNEST_MAX) ++ dbstate[nesting_level] = dolbrace_state; + nesting_level++; + i += 2; + if (dolbrace_state == DOLBRACE_QUOTE || dolbrace_state == DOLBRACE_WORD) +@@ -1864,6 +1871,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags) + nesting_level--; + if (nesting_level == 0) + break; ++ dolbrace_state = (nesting_level < PARAMEXPNEST_MAX) ? dbstate[nesting_level] : dbstate[0]; /* Guess using initial state */ + i++; + continue; + } +--- tests/extglob.right ++++ tests/extglob.right +@@ -182,3 +182,10 @@ no dotglob: .a .foo bar + ? . .. .a .foo + * + bar ++extglob off ++x ++extglob off ++extglob off ++extglob off ++extglob off ++extglob off +--- tests/extglob.tests ++++ tests/extglob.tests +@@ -386,5 +386,6 @@ ${THIS_SH} ./extglob4.sub + ${THIS_SH} ./extglob5.sub + ${THIS_SH} ./extglob6.sub + ${THIS_SH} ./extglob7.sub ++${THIS_SH} ./extglob8.sub + + exit 0 +--- /dev/null ++++ tests/extglob8.sub +@@ -0,0 +1,33 @@ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++# extglob option interaction with other parts of the shell that force ++# extended_glob on; only an issue in compatibility mode ++ ++shopt -u extglob ++ ++BASH_COMPAT=50 ++shopt extglob ++ ++echo $(echo $(echo $(echo $(echo $(echo x) ) ) ) ) ++shopt extglob ++ ++shopt -u extglob ++ ++[[ '' = $(shopt extglob >&2) ]] ++shopt extglob ++ ++shopt -u extglob ++ ++[[ foo = $(: $(shopt extglob >&2)) ]] ++shopt extglob +--- tests/run-extglob ++++ tests/run-extglob +@@ -1,4 +1,4 @@ + PATH=$PATH:`pwd` + export PATH +-${THIS_SH} ./extglob.tests | grep -v '^expect' > ${BASH_TSTOUT} ++${THIS_SH} ./extglob.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} + diff ${BASH_TSTOUT} extglob.right && rm -f ${BASH_TSTOUT} + diff --git a/app-shells/ctypes-sh/Manifest b/app-shells/ctypes-sh/Manifest index 57ea8d9d2113..f47c57eaa8d6 100644 --- a/app-shells/ctypes-sh/Manifest +++ b/app-shells/ctypes-sh/Manifest @@ -1,3 +1,3 @@ DIST ctypes-sh-1.2.tar.gz 475531 BLAKE2B 6fe00415244227629b952a0c18f9c95659a3fb22b9f17e109554f11084d27bf4c23eca5bfc49679b63367fa9fe74a20f206ac79955ed6588418033f37b776729 SHA512 23e9c30acc8ed5b4fe93fe1427c406e7c7b18067bbfc3f948126683910efc645cc69e426d771beb715148b54dffce75351b7773d8b54ac13f74d9787db8529f6 -EBUILD ctypes-sh-1.2-r1.ebuild 740 BLAKE2B 0f78f090cc8c7fcfbe8d117d4d302575297601e0588efbbaf9ea66954b51b182be586cc34919534baa5c8c1a6647afbecef6de8ed6e46d8d1590d1c85f457dc5 SHA512 0c509b7d3e64e3458498155fdd36ad5e70caa31219ae2ca9b2db6a150e69291c1bd19f14144b460e4487ddd27676ff35ef8d0ec1f6258de9e1ffa518ba44f81b +EBUILD ctypes-sh-1.2-r2.ebuild 742 BLAKE2B e101dd97e9cf60e1c439deca268802edca0be3bf5cf655a68db571a788006f01b842a7fc1494623fdf56cb7bf26e46d1724738efa9cc88d02aed27244f2f0a75 SHA512 95c22cc58c8ee2b58b92ce2dc254ab7ebbe3f5bdaa26cbcd5eab67273783f9e2f2876258fad6f8a9c71efe0290b12a84180007c3a9499028d45587abb5700f2d MISC metadata.xml 559 BLAKE2B 24fcb4347cb88adec14f281050bb817b798247bdf61ce0a2477b01b129cdcad222f06dd8ee93e0fe6082e26dae1665d790ea7be0b21eb456f1747e7edf89fdae SHA512 418b64e40fe7abf72bc7a0a10e727cd71acfe8ee4df8cdd50c4e069d4de44f43252dfde4a53a33e8800e989d9510a6d91e90f6fe8b0749c05c7f26767e90c998 diff --git a/app-shells/ctypes-sh/ctypes-sh-1.2-r1.ebuild b/app-shells/ctypes-sh/ctypes-sh-1.2-r1.ebuild deleted file mode 100644 index b4b3407a8bfb..000000000000 --- a/app-shells/ctypes-sh/ctypes-sh-1.2-r1.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools toolchain-funcs - -DESCRIPTION="Foreign function interface for bash" -HOMEPAGE="http://ctypes.sh/" -SRC_URI="https://github.com/taviso/${PN/-/.}/releases/download/v${PV}/${P}.tar.gz" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~amd64 ~x86" - -RDEPEND=" - app-arch/bzip2 - app-arch/xz-utils - app-shells/bash[plugins(-)] - dev-libs/libffi:= - virtual/libelf -" -DEPEND="${RDEPEND}" -BDEPEND="virtual/pkgconfig" - -src_prepare() { - default - eautoreconf -} - -src_test() { - pushd test >/dev/null || die - PATH="${S}:${PATH}" \ - LD_LIBRARY_PATH="${S}/src/.libs" \ - make CC="$(tc-getCC)" || die "make check failed" - popd > /dev/null || die -} diff --git a/app-shells/ctypes-sh/ctypes-sh-1.2-r2.ebuild b/app-shells/ctypes-sh/ctypes-sh-1.2-r2.ebuild new file mode 100644 index 000000000000..3b1a75ac8c21 --- /dev/null +++ b/app-shells/ctypes-sh/ctypes-sh-1.2-r2.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools toolchain-funcs + +DESCRIPTION="Foreign function interface for bash" +HOMEPAGE="http://ctypes.sh/" +SRC_URI="https://github.com/taviso/${PN/-/.}/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + app-arch/bzip2 + app-arch/xz-utils + app-shells/bash:=[plugins(-)] + dev-libs/libffi:= + virtual/libelf +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + eautoreconf +} + +src_test() { + pushd test >/dev/null || die + PATH="${S}:${PATH}" \ + LD_LIBRARY_PATH="${S}/src/.libs" \ + make CC="$(tc-getCC)" || die "make check failed" + popd > /dev/null || die +} -- cgit v1.2.3