Merge branch 'skip-git' into 'main'

check_whence.py: skip some validation if git ls-files fails

See merge request kernel-firmware/linux-firmware!339
This commit is contained in:
Mario Limonciello 2024-10-18 15:10:15 +00:00
commit 41a6688a08
1 changed files with 9 additions and 6 deletions

View File

@ -60,9 +60,12 @@ def list_links_list():
def list_git(): def list_git():
with os.popen("git ls-files") as git_files: git_files = os.popen("git ls-files")
for line in git_files: for line in git_files:
yield line.rstrip("\n") yield line.rstrip("\n")
if git_files.close():
sys.stderr.write("W: git file listing failed, skipping some validation\n")
def main(): def main():
@ -135,7 +138,7 @@ def main():
) )
ret = 1 ret = 1
for name in sorted(list(known_files - git_files)): for name in sorted(list(known_files - git_files) if len(git_files) else list()):
sys.stderr.write("E: %s listed in WHENCE does not exist\n" % name) sys.stderr.write("E: %s listed in WHENCE does not exist\n" % name)
ret = 1 ret = 1
@ -151,10 +154,10 @@ def main():
break break
valid_targets.add(dirname) valid_targets.add(dirname)
for link, target in sorted(links_list): for link, target in sorted(links_list if len(git_files) else list()):
if target not in valid_targets: if target not in valid_targets:
sys.stderr.write( sys.stderr.write(
"E: target %s of link %s in WHENCE" " does not exist\n" % (target, link) "E: target %s of link %s in WHENCE does not exist\n" % (target, link)
) )
ret = 1 ret = 1