diff options
author | Ross Burton <ross.burton@arm.com> | 2024-11-13 17:23:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-22 16:53:37 +0000 |
commit | 4336f06475692871efa0f493854019e9b8188848 (patch) | |
tree | ecc42f8080f6fb71351ee3af61c085e1f9647e30 /scripts/lib/checklayer/__init__.py | |
parent | 486ed07bd9e64f25bda5e8e1ed0cdbf9a6bac307 (diff) | |
download | poky-4336f06475692871efa0f493854019e9b8188848.tar.gz |
scripts/checklayer: check for SECURITY.md
Add a check for a SECURITY.md file (or similar) to yocto-check-layer, as
knowing where to report security issues is important.
(From OE-Core rev: c7cb22ac4ceed60f88452e83c907a4c4f33660e4)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/checklayer/__init__.py')
-rw-r--r-- | scripts/lib/checklayer/__init__.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 62ecdfe390..86aadf39a6 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py | |||
@@ -452,3 +452,15 @@ def compare_signatures(old_sigs, curr_sigs): | |||
452 | msg.extend([' ' + line for line in output.splitlines()]) | 452 | msg.extend([' ' + line for line in output.splitlines()]) |
453 | msg.append('') | 453 | msg.append('') |
454 | return '\n'.join(msg) | 454 | return '\n'.join(msg) |
455 | |||
456 | |||
457 | def get_git_toplevel(directory): | ||
458 | """ | ||
459 | Try and find the top of the git repository that directory might be in. | ||
460 | Returns the top-level directory, or None. | ||
461 | """ | ||
462 | cmd = ["git", "-C", directory, "rev-parse", "--show-toplevel"] | ||
463 | try: | ||
464 | return subprocess.check_output(cmd, text=True).strip() | ||
465 | except: | ||
466 | return None | ||