* [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them
@ 2021-11-13 12:42 Yann E. MORIN
2021-11-13 14:21 ` Thomas Petazzoni
2021-11-17 22:03 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2021-11-13 12:42 UTC (permalink / raw)
To: buildroot; +Cc: Yann E. MORIN, Thomas Petazzoni
The heuristic to extract the various variables of interest is pretty
crude: we filter on variables ending with certain suffixes (like
'%_VERSION' to get the version strings).
However, in doing so, we may dump variables that are not actual package
versions (especially with br2-external trees), and those may contain one
or more equal sign. And anyway, an actual package version string may
very well contain an equal sign too.
But the current situation is that the output of 'printvars' is split on
all equal signs, which will not fit in the 2-tuple we assign the result,
thus causing an exception.
Fix that by limiting to a single split.
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
support/scripts/pkg-stats | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
index 65ffa05f17..3992c8312a 100755
--- a/support/scripts/pkg-stats
+++ b/support/scripts/pkg-stats
@@ -388,7 +388,7 @@ def package_init_make_info():
for item in variable_list:
# Get variable name and value
- pkgvar, value = item.split("=")
+ pkgvar, value = item.split("=", maxsplit=1)
# Strip the suffix according to the variable
if pkgvar.endswith("_LICENSE"):
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them
2021-11-13 12:42 [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them Yann E. MORIN
@ 2021-11-13 14:21 ` Thomas Petazzoni
2021-11-17 22:03 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2021-11-13 14:21 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: buildroot
On Sat, 13 Nov 2021 13:42:34 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> The heuristic to extract the various variables of interest is pretty
> crude: we filter on variables ending with certain suffixes (like
> '%_VERSION' to get the version strings).
>
> However, in doing so, we may dump variables that are not actual package
> versions (especially with br2-external trees), and those may contain one
> or more equal sign. And anyway, an actual package version string may
> very well contain an equal sign too.
>
> But the current situation is that the output of 'printvars' is split on
> all equal signs, which will not fit in the 2-tuple we assign the result,
> thus causing an exception.
>
> Fix that by limiting to a single split.
>
> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
> support/scripts/pkg-stats | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master and next, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them
2021-11-13 12:42 [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them Yann E. MORIN
2021-11-13 14:21 ` Thomas Petazzoni
@ 2021-11-17 22:03 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-11-17 22:03 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Thomas Petazzoni, buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> The heuristic to extract the various variables of interest is pretty
> crude: we filter on variables ending with certain suffixes (like
> '%_VERSION' to get the version strings).
> However, in doing so, we may dump variables that are not actual package
> versions (especially with br2-external trees), and those may contain one
> or more equal sign. And anyway, an actual package version string may
> very well contain an equal sign too.
> But the current situation is that the output of 'printvars' is split on
> all equal signs, which will not fit in the 2-tuple we assign the result,
> thus causing an exception.
> Fix that by limiting to a single split.
> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Committed to 2021.02.x and 2021.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-17 22:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-13 12:42 [Buildroot] [PATCH] support/pkg-stats: support values with an equal sign in them Yann E. MORIN
2021-11-13 14:21 ` Thomas Petazzoni
2021-11-17 22:03 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox