diff options
author | Simone Weiß <simone.p.weiss@posteo.com> | 2024-05-30 11:15:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-31 16:58:36 +0100 |
commit | af6d28d2b0abdfcfa70edcc95abd99a3c1a64ac8 (patch) | |
tree | 09a8e7df721335256c24ae851e2159251dbbee76 /meta | |
parent | afe7a3a3841a054a4b0a947337c4de9039ee579d (diff) | |
download | poky-af6d28d2b0abdfcfa70edcc95abd99a3c1a64ac8.tar.gz |
sanity: Check if tar is gnutar
In sanity.bbclass the tar version is checked as tar needs to be recent enough
for reproducible builds. Tar could also be provided by other means then gnutar,
but we mean the version of gnutar in the check. Hence we also should ensure
that the installed tar is gnutar.
[YOCTO #14205]
(From OE-Core rev: bdef30bd887cd208d7822dd7853d33e24a6b7a4c)
Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes-global/sanity.bbclass | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 180c6b77d8..1d242f0f0a 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass | |||
@@ -495,12 +495,15 @@ def check_gcc_version(sanity_data): | |||
495 | # Tar version 1.24 and onwards handle overwriting symlinks correctly | 495 | # Tar version 1.24 and onwards handle overwriting symlinks correctly |
496 | # but earlier versions do not; this needs to work properly for sstate | 496 | # but earlier versions do not; this needs to work properly for sstate |
497 | # Version 1.28 is needed so opkg-build works correctly when reproducible builds are enabled | 497 | # Version 1.28 is needed so opkg-build works correctly when reproducible builds are enabled |
498 | # Gtar is assumed at to be used as tar in poky | ||
498 | def check_tar_version(sanity_data): | 499 | def check_tar_version(sanity_data): |
499 | import subprocess | 500 | import subprocess |
500 | try: | 501 | try: |
501 | result = subprocess.check_output(["tar", "--version"], stderr=subprocess.STDOUT).decode('utf-8') | 502 | result = subprocess.check_output(["tar", "--version"], stderr=subprocess.STDOUT).decode('utf-8') |
502 | except subprocess.CalledProcessError as e: | 503 | except subprocess.CalledProcessError as e: |
503 | return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output) | 504 | return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output) |
505 | if not "GNU" in result: | ||
506 | return "Your version of tar is not gtar. Please install gtar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" | ||
504 | version = result.split()[3] | 507 | version = result.split()[3] |
505 | if bb.utils.vercmp_string_op(version, "1.28", "<"): | 508 | if bb.utils.vercmp_string_op(version, "1.28", "<"): |
506 | return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" | 509 | return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" |