[PATCH] dim: allow all developer commands without full setup

Gustavo Padovan gustavo at padovan.org
Tue Nov 28 13:37:24 UTC 2017


2017-11-28 Daniel Vetter <daniel.vetter at ffwll.ch>:

> Requested by Arek (so CI can use sparse/checkpatch) and Chris (because
> it's more useful for developers this way).
> 
> v2: Remove debug leftover. Oops (Chris).
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  dim     | 27 ++++++++++++++++++++++++++-
>  dim.rst |  2 ++
>  2 files changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/dim b/dim
> index 283ae882f113..923ffa361f22 100755
> --- a/dim
> +++ b/dim
> @@ -2129,7 +2129,32 @@ if ! declare -f $subcmd_func >/dev/null; then
>  	exit 1
>  fi
>  
> -if [ "$subcmd" != "setup" ] && [ "$subcmd" != "help" ] && [ "$subcmd" != "usage" ]; then
> +# functions useful for developers don't need a full dim setup
> +developer_commands=(
> +	# developer commands
> +	# these should match the developer section in dim.rst
> +	"tc"
> +	"cite"
> +	"fixes"
> +	"checkpatch"
> +	"sparse"
> +	"checker"
> +	"retip"
> +	# help commands
> +	"help"
> +	"usage"
> +	# include setup
> +	"setup"
> +)
> +
> +developer_command=0
> +for cmd in "${developer_commands[@]}" ; do
> +	if [ $cmd = $subcmd ] ; then
> +		developer_command=1

Chris pointed that in the previous comment that you need a break here.

Otherwise both patches looks good to me.

Acked-by: Gustavo Padovan <gustavo.padovan at collabora.com>

Gustavo


More information about the dim-tools mailing list