diff options
| author | Ross Burton <ross.burton@intel.com> | 2017-12-05 17:51:37 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-10 22:45:20 +0000 |
| commit | 0b9be271137d169a76721cdbe2170682fa56c543 (patch) | |
| tree | 369e63ceb46b9a174b98398ba6162ff2cae53d76 /meta | |
| parent | daa509f9e42013029d443ee01e72c18357b6bc34 (diff) | |
| download | poky-0b9be271137d169a76721cdbe2170682fa56c543.tar.gz | |
classes/sanity: check we don't have an ancient GNU patch
We depend on the host GNU patch, but patch < 2.7 can't handle git-style patches.
This results in patches that fail to apply, or worse apply incorrectly.
(From OE-Core rev: ddda57ab1dee989dce8754350471807c916a6f47)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/sanity.bbclass | 17 |
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. | ||
| 461 | def 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. |
| 461 | def check_make_version(sanity_data): | 477 | def 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)) |
