[Pkg-xen-devel] [PATCH 03/19] d/shuffle-binaries: Make error detection/message overt

Hans van Kranenburg hans at knorrie.org
Fri Dec 4 20:48:35 GMT 2020


On 7/17/20 8:37 AM, Elliott Mitchell wrote:
> The reason for the `ls` at the end is pretty straightforward if you think
> about it, mainly confirming the shuffle step did something.  Yet that
> is a bit non-obvious, and the error message produced on failure is poor
> ("No such file or directory" simply means the script failed somewhere?).
> Add an overt error message.

Haha, yes, it's a bit of a too easy way out.

> Signed-off-by: Elliott Mitchell <ehem+debian at m5p.com>
> ---
>  debian/shuffle-binaries | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/debian/shuffle-binaries b/debian/shuffle-binaries
> index cff6de5428..31aa01e2bd 100755
> --- a/debian/shuffle-binaries
> +++ b/debian/shuffle-binaries
> @@ -47,4 +47,7 @@ for binary in `find $t/usr/{bin,sbin} -type f`; do
>  	)
>  done
>  
> -ls debian/shuffle-binaries.stamp
> +if [ ! -e "$0.stamp" ]; then
> +	echo "Failed to shuffle binaries!" 1>&2
> +	exit 1
> +fi

So, when getting the "Failed to shuffle binaries!", it's a better hint
at looking back in the build log to see whatever thing failed.

Acked-by: Hans van Kranenburg <hans at knorrie.org>

Added to knorrie/sid, thanks.
Hans

P.S. This was the first time I was reading/examining
debian/shuffle-binaries and it shows that I'm not a shell script guru at
all. I see some exit 0 halfway a loop, and then I think: "ewww! what's
going on here?" and then I see all the sub-shell stuff going on.



More information about the Pkg-xen-devel mailing list