1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

scripts/bitbake sanity.bbclass: Migrate tests for git and tar versions

Migrate tests for correct git and tar versions from the wrapper script
to the sanity class.

This sets the scene to allow us to remove the bitbake wrapper script.

(From OE-Core rev: 7b370e23594da5dcb53cd5507ec289c3ef2d9fb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-06-07 18:16:03 +01:00
parent 9d18a291a6
commit cfbd13ff22
2 changed files with 32 additions and 41 deletions
+31
View File
@@ -359,6 +359,28 @@ def check_gcc_march(sanity_data):
return result
# Tar version 1.24 and onwards handle overwriting symlinks correctly
# but earlier versions do not; this needs to work properly for sstate
def check_tar_version(sanity_data, loosever):
status, result = oe.utils.getstatusoutput("tar --version")
if status != 0:
return "Unable to execute tar --version, exit code %s\n" % status
version = result.split()[3]
if loosever(version) < loosever("1.24"):
return "Your version of tar is older than 1.24 and has bugs which will break builds. Please install a newer version of tar.\n"
return None
# We use git parameters and functionality only found in 1.7.5 or later
def check_git_version(sanity_data, loosever):
status, result = oe.utils.getstatusoutput("git --version 2> /dev/null")
if status != 0:
return "Unable to execute git --version, exit code %s\n" % status
version = result.split()[2]
if loosever(version) < loosever("1.7.5"):
return "Your version of git is older than 1.7.5 and has bugs which will break builds. Please install a newer version of git.\n"
return None
def check_sanity(sanity_data):
import subprocess
@@ -409,6 +431,15 @@ def check_sanity(sanity_data):
messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
machinevalid = False
tarmsg = check_tar_version(sanity_data, LooseVersion)
if tarmsg:
messages = messages + tarmsg
gitmsg = check_git_version(sanity_data, LooseVersion)
if gitmsg:
messages = messages + gitmsg
# Check we are using a valid local.conf
current_conf = sanity_data.getVar('CONF_VERSION', True)
conf_version = sanity_data.getVar('LOCALCONF_VERSION', True)