[elbe-devel] [PATCH v2 11/15] validate: check for norecommend and output a verbose message

John Ogness john.ogness at linutronix.de
Thu May 16 09:42:58 CEST 2019


On 2019-05-16, Torben Hohn <torben.hohn at linutronix.de> wrote:
> because norecommend did the opposite, it was removed from the schema
> and replaced with <install-recommends />.
>
> Add a message about this to the validation output, so that its clear,
> what has to be done.

See comments below...

> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: John Ogness <john.ogness at linutronix.de>

> ---
>  elbepack/validate.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/elbepack/validate.py b/elbepack/validate.py
> index 209823d0d..02435a96b 100644
> --- a/elbepack/validate.py
> +++ b/elbepack/validate.py
> @@ -36,15 +36,23 @@ def validate_xml(fname):
>      # We have errors, return them in string form...
>      errors = []
>      uses_xinclude = False
> +    uses_norecommend = False
>  
>      for err in schema.error_log:
>          errors.append("%s:%d error %s" % (err.filename, err.line, err.message))
>          if "http://www.w3.org/2003/XInclude" in err.message:
>              uses_xinclude = True
> +        if "norecommend" in err.message:
> +            uses_norecommend = True

I don't like that the error message is parsed. This could probably
generate some false positives (for specially crafted XML files). I think
it makes more sense to actually check for the node in the XML file (with
xml.contains("norecommend") or something). But since all this stuff
should be killed at some point in the future anyway, I'm OK with it
being added as is.



More information about the elbe-devel mailing list