From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1AB681389E2 for ; Thu, 4 Dec 2014 14:01:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B8F5E08B2; Thu, 4 Dec 2014 14:01:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D809E08AB for ; Thu, 4 Dec 2014 14:01:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 89A13340641 for ; Thu, 4 Dec 2014 14:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D35BCB8F6 for ; Thu, 4 Dec 2014 14:01:46 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1417701695.3e485f7c051955295dc4cc4792a984a9879b489d.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/eapi.sh bin/ebuild.sh X-VCS-Directories: bin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3e485f7c051955295dc4cc4792a984a9879b489d X-VCS-Branch: master Date: Thu, 4 Dec 2014 14:01:46 +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-Archives-Salt: aaf28da0-b73a-4a0e-9bb3-afc9ac477816 X-Archives-Hash: 86a110bfdb6bb5bb7f4a815b911af751 commit: 3e485f7c051955295dc4cc4792a984a9879b489d Author: Michał Górny gentoo org> AuthorDate: Mon Aug 18 07:47:10 2014 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Dec 4 14:01:35 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e485f7c Enable tentative EAPI6 failglob in global scope Enable failglob in global scope to catch unintended globbing attempts including unescaped special uses of '*'. --- bin/eapi.sh | 4 ++++ bin/ebuild.sh | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/bin/eapi.sh b/bin/eapi.sh index 6e78750..fa57999 100644 --- a/bin/eapi.sh +++ b/bin/eapi.sh @@ -160,6 +160,10 @@ ___eapi_unpack_is_case_sensitive() { # OTHERS +___eapi_enables_failglob_in_global_scope() { + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] +} + ___eapi_enables_globstar() { [[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]] } diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 9c60a41..e6f9cb9 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -565,6 +565,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then # we make a backup copy for QA checks. __INHERITED_QA_CACHE=$INHERITED + # Catch failed globbing attempts in case ebuild writer forgot to + # escape '*' or likes. + # Note: this needs to be done before unsetting EAPI. + if ___eapi_enables_failglob_in_global_scope; then + shopt -s failglob + fi + # *DEPEND and IUSE will be set during the sourcing of the ebuild. # In order to ensure correct interaction between ebuilds and # eclasses, they need to be unset before this process of @@ -581,6 +588,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then set +x fi + if ___eapi_enables_failglob_in_global_scope; then + shopt -u failglob + fi + if [[ "${EBUILD_PHASE}" != "depend" ]] ; then RESTRICT=${PORTAGE_RESTRICT} [[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \