All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: Add a help message when dtschema tools are missing
@ 2021-10-26 17:18 Rob Herring
  2021-10-27  7:30 ` Luca Ceresoli
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-10-26 17:18 UTC (permalink / raw)
  To: devicetree; +Cc: linux-kernel, Luca Ceresoli, Masahiro Yamada

The dtschema version check works, but is not that clear when dtschema is
neither installed nor in the PATH. Add a separate check and message if
dt-doc-validate is not found.

Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index 8d6d912c6a6a..001b4f62b741 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -9,6 +9,10 @@ DT_SCHEMA_MIN_VERSION = 2021.2.1
 
 PHONY += check_dtschema_version
 check_dtschema_version:
+	@which $(DT_DOC_CHECKER) >/dev/null || \
+		{ echo "Error: '$(DT_DOC_CHECKER)' not found!" \
+		"\nEnsure dtschema python package is installed and in your PATH." \
+		"\nCurrent PATH is:\n$$PATH\n" >&2; false; }
 	@{ echo $(DT_SCHEMA_MIN_VERSION); \
 	$(DT_DOC_CHECKER) --version 2>/dev/null || echo 0; } | sort -Vc >/dev/null || \
 	{ echo "ERROR: dtschema minimum version is v$(DT_SCHEMA_MIN_VERSION)" >&2; false; }
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: Add a help message when dtschema tools are missing
  2021-10-26 17:18 [PATCH] dt-bindings: Add a help message when dtschema tools are missing Rob Herring
@ 2021-10-27  7:30 ` Luca Ceresoli
  2021-10-27 13:53   ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Ceresoli @ 2021-10-27  7:30 UTC (permalink / raw)
  To: Rob Herring, devicetree; +Cc: linux-kernel, Masahiro Yamada

Hi Rob,

thanks for this patch!

On 26/10/21 19:18, Rob Herring wrote:
> The dtschema version check works, but is not that clear when dtschema is
> neither installed nor in the PATH. Add a separate check and message if

Nit: I think it should say "either not installed or not in the PATH".

> dt-doc-validate is not found.
>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  Documentation/devicetree/bindings/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> index 8d6d912c6a6a..001b4f62b741 100644
> --- a/Documentation/devicetree/bindings/Makefile
> +++ b/Documentation/devicetree/bindings/Makefile
> @@ -9,6 +9,10 @@ DT_SCHEMA_MIN_VERSION = 2021.2.1
>  
>  PHONY += check_dtschema_version
>  check_dtschema_version:
> +	@which $(DT_DOC_CHECKER) >/dev/null || \
> +		{ echo "Error: '$(DT_DOC_CHECKER)' not found!" \
> +		"\nEnsure dtschema python package is installed and in your PATH." \
> +		"\nCurrent PATH is:\n$$PATH\n" >&2; false; }

You need 'echo -e' for the '\n'.

Otherwise looks and works well.

-- 
Luca

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: Add a help message when dtschema tools are missing
  2021-10-27  7:30 ` Luca Ceresoli
@ 2021-10-27 13:53   ` Rob Herring
  2021-10-27 14:20     ` Luca Ceresoli
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-10-27 13:53 UTC (permalink / raw)
  To: Luca Ceresoli; +Cc: devicetree, linux-kernel, Masahiro Yamada

On Wed, Oct 27, 2021 at 2:30 AM Luca Ceresoli <luca@lucaceresoli.net> wrote:
>
> Hi Rob,
>
> thanks for this patch!
>
> On 26/10/21 19:18, Rob Herring wrote:
> > The dtschema version check works, but is not that clear when dtschema is
> > neither installed nor in the PATH. Add a separate check and message if
>
> Nit: I think it should say "either not installed or not in the PATH".

Right.

>
> > dt-doc-validate is not found.
> >
> > Cc: Luca Ceresoli <luca@lucaceresoli.net>
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/Makefile | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> > index 8d6d912c6a6a..001b4f62b741 100644
> > --- a/Documentation/devicetree/bindings/Makefile
> > +++ b/Documentation/devicetree/bindings/Makefile
> > @@ -9,6 +9,10 @@ DT_SCHEMA_MIN_VERSION = 2021.2.1
> >
> >  PHONY += check_dtschema_version
> >  check_dtschema_version:
> > +     @which $(DT_DOC_CHECKER) >/dev/null || \
> > +             { echo "Error: '$(DT_DOC_CHECKER)' not found!" \
> > +             "\nEnsure dtschema python package is installed and in your PATH." \
> > +             "\nCurrent PATH is:\n$$PATH\n" >&2; false; }
>
> You need 'echo -e' for the '\n'.

Except dash will just print '-e' and interpret the newlines...

I changed it like this:

@which $(DT_DOC_CHECKER) >/dev/null || \
{ echo "Error: '$(DT_DOC_CHECKER)' not found!" >&2; \
  echo "Ensure dtschema python package is installed and in your PATH." >&2; \
  echo "Current PATH is:" >&2; \
  echo "$$PATH" >&2; false; }

Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: Add a help message when dtschema tools are missing
  2021-10-27 13:53   ` Rob Herring
@ 2021-10-27 14:20     ` Luca Ceresoli
  0 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2021-10-27 14:20 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel, Masahiro Yamada

Hi,

On 27/10/21 15:53, Rob Herring wrote:
> On Wed, Oct 27, 2021 at 2:30 AM Luca Ceresoli <luca@lucaceresoli.net> wrote:
>>
>> Hi Rob,
>>
>> thanks for this patch!
>>
>> On 26/10/21 19:18, Rob Herring wrote:
>>> The dtschema version check works, but is not that clear when dtschema is
>>> neither installed nor in the PATH. Add a separate check and message if
>>
>> Nit: I think it should say "either not installed or not in the PATH".
> 
> Right.
> 
>>
>>> dt-doc-validate is not found.
>>>
>>> Cc: Luca Ceresoli <luca@lucaceresoli.net>
>>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>>> Signed-off-by: Rob Herring <robh@kernel.org>
>>> ---
>>>  Documentation/devicetree/bindings/Makefile | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
>>> index 8d6d912c6a6a..001b4f62b741 100644
>>> --- a/Documentation/devicetree/bindings/Makefile
>>> +++ b/Documentation/devicetree/bindings/Makefile
>>> @@ -9,6 +9,10 @@ DT_SCHEMA_MIN_VERSION = 2021.2.1
>>>
>>>  PHONY += check_dtschema_version
>>>  check_dtschema_version:
>>> +     @which $(DT_DOC_CHECKER) >/dev/null || \
>>> +             { echo "Error: '$(DT_DOC_CHECKER)' not found!" \
>>> +             "\nEnsure dtschema python package is installed and in your PATH." \
>>> +             "\nCurrent PATH is:\n$$PATH\n" >&2; false; }
>>
>> You need 'echo -e' for the '\n'.
> 
> Except dash will just print '-e' and interpret the newlines...

Oh dear, I always forget about dash...

> I changed it like this:
> 
> @which $(DT_DOC_CHECKER) >/dev/null || \
> { echo "Error: '$(DT_DOC_CHECKER)' not found!" >&2; \
>   echo "Ensure dtschema python package is installed and in your PATH." >&2; \
>   echo "Current PATH is:" >&2; \
>   echo "$$PATH" >&2; false; }

Either that or 'printf', which IIRC is more portable, including with \n.
But in this simple case I find multiple 'echo's more readable than one
printf with '\n's.

-- 
Luca

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-27 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26 17:18 [PATCH] dt-bindings: Add a help message when dtschema tools are missing Rob Herring
2021-10-27  7:30 ` Luca Ceresoli
2021-10-27 13:53   ` Rob Herring
2021-10-27 14:20     ` Luca Ceresoli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.