Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 711207 Details for
Bug 636652
[Future EAPI] Update Bash version to 5.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Ban nameref variables from exported and default scope
0001-Ban-nameref-variables-from-exported-and-default-scop.patch (text/plain), 1.85 KB, created by
Ulrich Müller
on 2021-05-25 16:20:46 UTC
(
hide
)
Description:
Ban nameref variables from exported and default scope
Filename:
MIME Type:
Creator:
Ulrich Müller
Created:
2021-05-25 16:20:46 UTC
Size:
1.85 KB
patch
obsolete
>From 364746528f55a84c683dfb0e80a30a1b649fdd64 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org> >Date: Tue, 25 May 2021 17:59:13 +0200 >Subject: [PATCH] Ban nameref variables from exported and default scope >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Nameref variables will break detection of Bash arrays. The default >src_prepare() has this test: > > [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]] > >If PATCHES is a name reference and its target is an array, then >declare -p will _not_ resolve the indirection, but output "declare -n" >instead. > >We could work around this by updating the test to: > > ( unset "PATCHES[1]" 2>/dev/null ) > >using the fact that unset will return an error status when applied >to an element (other than the zeroth) of a scalar variable. However, >this looks like a very hackish solution which could break with future >Bash versions. > >Bug: https://bugs.gentoo.org/636652 >Signed-off-by: Ulrich Müller <ulm@gentoo.org> >--- > ebuild-format.tex | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/ebuild-format.tex b/ebuild-format.tex >index 4929ba4..3f45242 100644 >--- a/ebuild-format.tex >+++ b/ebuild-format.tex >@@ -11,6 +11,8 @@ compatibility settings (e.\,g.\ the \t{BASH_COMPAT} variable) are not exported t > option of bash is set in the global scope of ebuilds. If set, failed pattern matches during > filename expansion result in an error when the ebuild is being sourced. > >+Name reference variables (introduced in Bash version~4.3) must not be used, except in local scope. >+ > The file encoding must be UTF-8 with Unix-style newlines. When sourced, the ebuild must define > certain variables and functions (see chapters~\ref{ch:ebuild-vars} and~\ref{ch:ebuild-functions} > for specific information), and must not call any external programs, write anything to standard >-- >2.31.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 636652
:
502746
| 711207