[elbe-devel] [PATCH] dump: Change log level for archive validation

Torben Hohn torben.hohn at linutronix.de
Wed Mar 25 17:49:40 CET 2020


On Tue, Mar 24, 2020 at 02:49:53PM -0400, Olivier Dion wrote:
> Elbe will detect when a file, coming from an archive, is truncated.
> However, this leads to false positive errors when the user is
> expecting to have this file truncated.  For example, the user could
> run a script, part of the archive, and then delete it in the
> finetuning section.
> 
> Since the validation file is quite small, it's easy to the eyes to see
> if there was an error.  Hence, instead of generating errors and thus
> failing the build, Elbe will emit warnings.  Consequently, it's the
> user responsibility to ensure that the warnings in the validation file
> are in accordance with their usage of the finetuning section.
> 
> In the future, sub-tags could be added to the 'archive' tag in order
> to keep the build fail on error.  Those sub-tags would give a way for
> the user to cherry-pick which files to expect to have been truncated.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

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

> ---
>  elbepack/dump.py | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/elbepack/dump.py b/elbepack/dump.py
> index cb59d747..cde805a7 100644
> --- a/elbepack/dump.py
> +++ b/elbepack/dump.py
> @@ -307,19 +307,12 @@ def elbe_report(xml, buildenv, cache, targetfs):
>      validation.info("------------------")
>      validation.info("")
>  
> -    errors = 0
> -
>      for fpath in list(mt_index_postarch.keys()):
> -        if fpath not in mt_index or \
> -                mt_index_postarch[fpath] != mt_index[fpath]:
> +        if (fpath not in mt_index or
> +            mt_index_postarch[fpath] != mt_index[fpath]):
>              if fpath not in mt_index_post_fine:
> -                validation.error("Archive file %s deleted in finetuning",
> -                                 fpath)
> -                errors += 1
> +                validation.warning("Archive file %s deleted in finetuning",
> +                                   fpath)
>              elif mt_index_post_fine[fpath] != mt_index_postarch[fpath]:
> -                validation.error("Archive file %s modified in finetuning",
> -                                 fpath)
> -                errors += 1
> -
> -    if errors == 0:
> -        validation.info("No Errors found")
> +                validation.warning("Archive file %s modified in finetuning",
> +                                   fpath)
> -- 
> 2.25.1
> 

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list