Summary: | [Future EAPI] Enable 'nullglob' or 'failglob' in phase scope | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Michał Górny <mgorny> |
Component: | PMS/EAPI | Assignee: | PMS/EAPI <pms> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | esigra |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=667682 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 174380 |
Description
Michał Górny
![]() ![]() ![]() ![]() (In reply to Michał Górny from comment #0) The argument for introducing this in global scope (see bug 463822) was much stronger than it is for function scope. > 2. If 'nullglob' is enabled, *.txt evaluates to empty list and the loop is > not run at all. Some cases of missing quoting will cause silent or > unexpected breakages. Consider the following example: doinfo foo*.info bar*.info Now if for some reason foo*.info doesn't exist (because upstream has renamed the file, or because makeinfo failed), currently an unexpanded foo*.info will be passed as doinfo's argument and the error will be caught. However, with nullglob the problem would be silently ignored. Even worse occurs for commands like "cat *.txt >foo || die" where nullglob would result in cat reading from stdin instead of failing. > 3. If 'failglob' is enabled, the ebuild is terminated immediately with > error. Therefore, the ebuild author is expected to set what he expected > explicitly. Some cases of missing quoting will trigger an explicit error. See your for-loop example, or the following from elisp-common.eclass: for sf in "${sitelisp}"/site-gentoo.d/[0-9][0-9]*.el; do [[ -r ${sf} ]] && sflist+=("${sf}") done Here the empty expansion is perfectly valid, and at the same time is trivial to catch. How would one handle this with failglob enabled? So I'd rather keep bash default behaviour in function scope. I agree here and withdraw my proposal. |