[PATCH libdrm 01/11] symbols-check: add new meta-script

Emil Velikov emil.l.velikov at gmail.com
Thu Sep 6 15:49:10 UTC 2018


On 4 April 2018 at 16:41, Eric Engestrom <eric.engestrom at imgtec.com> wrote:

> --- /dev/null
> +++ b/symbols-check
> @@ -0,0 +1,79 @@
> +#!/bin/sh
> +set -eu
> +set -o pipefail
> +
We could drop the execute bit, shebang and set. Pretty much all of it
is handled by the callers (modulo pipefail)

> +if [ -z "$LIB" ]; then
> +  echo "\$LIB needs to be defined for autotools to be able to run this test"
> +  exit 1
> +fi
> +
> +# The lib name is passed in with Meson but autotools doesn't support that
> +# so it needs to be hardcoded and overwritten here
> +if [ $# -ge 1 ]; then
> +  LIB=$1
> +fi
> +
> +if ! [ -f "$LIB" ]; then
> +  echo "lib $LIB doesn't exist"
> +  exit 1
> +fi
> +
> +if [ -z "$NM" ]; then
> +  echo "\$NM is undefined or empty"
> +  exit 1

I would drop all these - set -u will provide reasonable error handling

HTH
Emil


More information about the dri-devel mailing list