lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 27 Oct 2021 16:20:14 +0200
From:   Luca Ceresoli <luca@...aceresoli.net>
To:     Rob Herring <robh@...nel.org>
Cc:     devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: [PATCH] dt-bindings: Add a help message when dtschema tools are
 missing

Hi,

On 27/10/21 15:53, Rob Herring wrote:
> On Wed, Oct 27, 2021 at 2:30 AM Luca Ceresoli <luca@...aceresoli.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@...aceresoli.net>
>>> Cc: Masahiro Yamada <masahiroy@...nel.org>
>>> Signed-off-by: Rob Herring <robh@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ