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]
Message-ID: <CAK7LNASVSit9NL3YYRT0vyJwRE8A0J5njDO5LXTWecGo0S2dXg@mail.gmail.com>
Date:   Sat, 18 Apr 2020 02:55:54 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Rob Herring <robh@...nel.org>
Cc:     DTML <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] dt-bindings: Add a minimum version check for dtschema

On Sat, Apr 18, 2020 at 12:42 AM Rob Herring <robh@...nel.org> wrote:
>
> The dtschema package must be somewhat up to date as the tools and
> meta-schema checks are still evolving. Implement a version check,
> so this can be enforced. This will help ensure new schema submissions
> get checked against the latest meta-schemas.
>
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Signed-off-by: Rob Herring <robh@...nel.org>
> ---
> v2:
>  - Use a build rule for the version check instead
>
>  Documentation/devicetree/bindings/Makefile | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> index 1df680d07461..daf0dda45a78 100644
> --- a/Documentation/devicetree/bindings/Makefile
> +++ b/Documentation/devicetree/bindings/Makefile
> @@ -3,11 +3,19 @@ DT_DOC_CHECKER ?= dt-doc-validate
>  DT_EXTRACT_EX ?= dt-extract-example
>  DT_MK_SCHEMA ?= dt-mk-schema
>
> +DT_SCHEMA_MIN_VERSION = 2020.04

Just a nit:

You can use 2020.4 if you want to be consistent
with the output from 'dt-doc-validate  --version'

This is not a big deal, though.
It is up to you.


$ dt-doc-validate  --version
2020.4



> +
> +PHONY += check_dtschema_version
> +check_dtschema_version:
> +       @printf "%s\n" $(DT_SCHEMA_MIN_VERSION) \
> +         $$($(DT_DOC_CHECKER) --version 2>/dev/null || echo 0) | sort -VC || \
> +         (echo "ERROR: dtschema minimum version is v$(DT_SCHEMA_MIN_VERSION)"; exit 1) 1>&2
> +


The  ( ... ) run the given command in a sub-shell.
{ ... } does not spawn a sub-shell, so it is a bit more
efficient if you do not have a good reason
to run it in a sub-shell.

I prefer 'false' instead of 'exit 1' because we do not
need to specify the exit code explicitly.
'false' is used in the top Makefile to stop the build.

I want to place the '1>&2' close to the error message,
and you can omit the redundant '1'.


How about this?


check_dtschema_version:
        @{ echo $(DT_SCHEMA_MIN_VERSION); \
        $(DT_DOC_CHECKER) --version 2>/dev/null || echo 0; } | sort -VC || \
        { echo "ERROR: dtschema minimum version is
v$(DT_SCHEMA_MIN_VERSION)" >&2; false; }




-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ