[Buildroot] [RFC PATCH] pkg-stats: Ignore make output without '=' character

Arnout Vandecappelle arnout at mind.be
Tue Nov 23 15:31:44 UTC 2021



On 23/11/2021 13:15, Cyril Bur wrote:
> It is possible that some users of buildroot have put it in a repository
> and call into it from another Makefile such as:
> .DEFAULT:
> 	$(MAKE) O=$(abspath $(O)) -C buildroot $(@)
> 
> This technique works well except that Make tells us that it changes into
> the buildroot directory:
> make[1]: Entering directory 'buildroot'

  A better fix for this particular issue is for pkg-stats to call make with the 
--no-print-directory option.

  Regards,
  Arnout

> 
> Because this line doesn't have an equals within it, python raises a
> ValueError exception within pkg-stats.
> 
> Signed-off-by: Cyril Bur <cyrilbur at gmail.com>
> ---
> I have no idea if this technique fits in the buildroot philosophy
> or if buildroot even wants to accommodate this but it sure would be
> nice for me.
> 
>   support/scripts/pkg-stats | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
> index 3992c8312a..814e6f8855 100755
> --- a/support/scripts/pkg-stats
> +++ b/support/scripts/pkg-stats
> @@ -388,7 +388,10 @@ def package_init_make_info():
>   
>       for item in variable_list:
>           # Get variable name and value
> -        pkgvar, value = item.split("=", maxsplit=1)
> +        try:
> +            pkgvar, value = item.split("=", maxsplit=1)
> +        except ValueError e:
> +            continue
>   
>           # Strip the suffix according to the variable
>           if pkgvar.endswith("_LICENSE"):
> 


More information about the buildroot mailing list