summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-07 18:16:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 12:53:51 +0100
commitcfbd13ff2267a10767327622c9cf5bf889e75a80 (patch)
tree5a8358c60d589955f63f8338cd1a66b18e1ade0d /meta/classes
parent9d18a291a69786823e404b9379e60629cc898ddb (diff)
downloadpoky-cfbd13ff2267a10767327622c9cf5bf889e75a80.tar.gz
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>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/sanity.bbclass31
1 files changed, 31 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 1c45b5baac..9a29f328f6 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -359,6 +359,28 @@ def check_gcc_march(sanity_data):
359 359
360 return result 360 return result
361 361
362# Tar version 1.24 and onwards handle overwriting symlinks correctly
363# but earlier versions do not; this needs to work properly for sstate
364def check_tar_version(sanity_data, loosever):
365 status, result = oe.utils.getstatusoutput("tar --version")
366 if status != 0:
367 return "Unable to execute tar --version, exit code %s\n" % status
368 version = result.split()[3]
369 if loosever(version) < loosever("1.24"):
370 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"
371 return None
372
373# We use git parameters and functionality only found in 1.7.5 or later
374def check_git_version(sanity_data, loosever):
375 status, result = oe.utils.getstatusoutput("git --version 2> /dev/null")
376 if status != 0:
377 return "Unable to execute git --version, exit code %s\n" % status
378 version = result.split()[2]
379 if loosever(version) < loosever("1.7.5"):
380 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"
381 return None
382
383
362def check_sanity(sanity_data): 384def check_sanity(sanity_data):
363 import subprocess 385 import subprocess
364 386
@@ -409,6 +431,15 @@ def check_sanity(sanity_data):
409 messages = messages + 'Please set a MACHINE in your local.conf or environment\n' 431 messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
410 machinevalid = False 432 machinevalid = False
411 433
434 tarmsg = check_tar_version(sanity_data, LooseVersion)
435 if tarmsg:
436 messages = messages + tarmsg
437
438 gitmsg = check_git_version(sanity_data, LooseVersion)
439 if gitmsg:
440 messages = messages + gitmsg
441
442
412 # Check we are using a valid local.conf 443 # Check we are using a valid local.conf
413 current_conf = sanity_data.getVar('CONF_VERSION', True) 444 current_conf = sanity_data.getVar('CONF_VERSION', True)
414 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True) 445 conf_version = sanity_data.getVar('LOCALCONF_VERSION', True)