* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Fail on command-not-found in global scope
@ 2017-08-31 17:42 99% ` Zac Medico
0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2017-08-31 17:42 UTC (permalink / raw
To: gentoo-portage-dev, Michał Górny
On 08/31/2017 07:56 AM, Michał Górny wrote:
> The PMS specifies that ebuilds must not call external commands in global
> scope. We can not prevent that from happening at the moment since a few
> ebuilds in Gentoo are still doing that.
>
> Instead, start increasing strictness by explicitly failing if ebuilds
> call external commands that are not found. This is not going to really
> break any ebuilds that are not broken already (since command-not-found
> usually indicates something is going wrong), and it will help noticing
> typos and reliance on non-common external commands.
>
> A similar change has been tested in pkgcore, and confirmed not to cause
> any failures with the current state of the Gentoo repository.
>
> Closes: https://github.com/gentoo/portage/pull/198
> ---
> bin/ebuild.sh | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> index f1ac3f278..c23561651 100755
> --- a/bin/ebuild.sh
> +++ b/bin/ebuild.sh
> @@ -79,6 +79,10 @@ else
> eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }"
> done
> unset funcs x
> +
> + command_not_found_handle() {
> + die "Command not found while sourcing ebuild: ${*}"
> + }
> fi
>
> # Don't use sandbox's BASH_ENV for new shells because it does
>
Looks good. Please merge.
--
Thanks,
Zac
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-08-31 14:56 [gentoo-portage-dev] [PATCH] ebuild.sh: Fail on command-not-found in global scope Michał Górny
2017-08-31 17:42 99% ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox