summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 1410af2901..d0f507e0c5 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -456,6 +456,22 @@ def check_sanity_validmachine(sanity_data):
456 456
457 return messages 457 return messages
458 458
459# Patch before 2.7 can't handle all the features in git-style diffs. Some
460# patches may incorrectly apply, and others won't apply at all.
461def check_patch_version(sanity_data):
462 from distutils.version import LooseVersion
463 import re, subprocess
464
465 try:
466 result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT, universal_newlines=True)
467 version = re.search(r"[0-9.]+", result.splitlines()[0]).group()
468 if LooseVersion(version) < LooseVersion("2.7"):
469 return "Your version of patch is older than 2.7 and has bugs which will break builds. Please install a newer version of patch.\n"
470 else:
471 return None
472 except subprocess.CalledProcessError as e:
473 return "Unable to execute patch --version, exit code %d:\n%s\n" % (e.returncode, e.output)
474
459# Unpatched versions of make 3.82 are known to be broken. See GNU Savannah Bug 30612. 475# Unpatched versions of make 3.82 are known to be broken. See GNU Savannah Bug 30612.
460# Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate. 476# Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate.
461def check_make_version(sanity_data): 477def check_make_version(sanity_data):
@@ -596,6 +612,7 @@ def check_sanity_version_change(status, d):
596 import stat 612 import stat
597 613
598 status.addresult(check_make_version(d)) 614 status.addresult(check_make_version(d))
615 status.addresult(check_patch_version(d))
599 status.addresult(check_tar_version(d)) 616 status.addresult(check_tar_version(d))
600 status.addresult(check_git_version(d)) 617 status.addresult(check_git_version(d))
601 status.addresult(check_perl_modules(d)) 618 status.addresult(check_perl_modules(d))