[PATCH 2/2] dim: allow all developer commands without full setup
Chris Wilson
chris at chris-wilson.co.uk
Tue Nov 28 11:08:25 UTC 2017
Quoting Daniel Vetter (2017-11-28 10:55:10)
> Requested by Arek (so CI can use sparse/checkpatch) and Chris (because
> it's more useful for developers this way).
>
> 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 | 29 ++++++++++++++++++++++++++++-
> dim.rst | 2 ++
> 2 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 283ae882f113..566a1124a388 100755
> --- a/dim
> +++ b/dim
> @@ -2129,8 +2129,35 @@ 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
break
> + fi
> +done
> +
> +if [ $developer_command = "0" ]; then
> for d in $DIM_PREFIX $DIM_PREFIX/$DIM_REPO $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
> + echoerr fuck 1
> + exit 1
Debug left over?
Otherwise, this looks very useful, a starting point to replace the rest
of my homebrew scripts.
-Chris
More information about the dim-tools
mailing list