]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
waf: Improve version parsing to avoid failing on warnings
authorYoann Congal <yoann.congal@smile.fr>
Thu, 29 Feb 2024 09:59:36 +0000 (10:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Mar 2024 09:30:39 +0000 (09:30 +0000)
commit643b799a0c11d82907dd82991c19b003fe20a8b0
tree782ac9db6a9e8e836160b775146aab0832d7bcca
parenta741be42bde1624dcd49bb914dfa8b3c00fbe38a
waf: Improve version parsing to avoid failing on warnings

waf uses an inline tar file extracted by the tarfile module. The tarfile
module may print a warning when used with default 'filter' argument[0].

When called to get the version, the first time after unpack, the output
may look like:
  # output from lower modules (e.g: warnings from tarfile, ...)
  waf X.Y.Z ...

This patch makes the version parsing more precise by looking at the
first line matching "waf ".

[0]: https://docs.python.org/3.12/library/tarfile.html#extraction-filters

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/waf.bbclass