Re: [gentoo-portage-dev] [PATCH] eend: Output QA notice when called without argument

2021-09-03 Thread Michał Górny
On Fri, 2021-09-03 at 18:58 +0200, Ulrich Müller wrote:
> PMS says about eend: "Takes one fixed argument, which is a numeric
> return code, and an optional message in all subsequent arguments."
> 
> Bug: https://bugs.gentoo.org/703520
> Signed-off-by: Ulrich Müller 
> ---
>  bin/isolated-functions.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
> index b495ae6c7..5b1f372d2 100644
> --- a/bin/isolated-functions.sh
> +++ b/bin/isolated-functions.sh
> @@ -364,6 +364,7 @@ __eend() {
>  }
>  
>  eend() {
> + [[ -n $1 ]] || eqawarn "QA Notice: eend called without return code"
>   local retval=${1:-0}
>   shift
>  

I think the message could be a bit confusing.  Maybe say explicitly that
it's missing an argument.

-- 
Best regards,
Michał Górny





[gentoo-portage-dev] [PATCH] eend: Output QA notice when called without argument

2021-09-03 Thread Ulrich Müller
PMS says about eend: "Takes one fixed argument, which is a numeric
return code, and an optional message in all subsequent arguments."

Bug: https://bugs.gentoo.org/703520
Signed-off-by: Ulrich Müller 
---
 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index b495ae6c7..5b1f372d2 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -364,6 +364,7 @@ __eend() {
 }
 
 eend() {
+   [[ -n $1 ]] || eqawarn "QA Notice: eend called without return code"
local retval=${1:-0}
shift
 
-- 
2.33.0