diff options
| author | Emil Velikov <emil.l.velikov@gmail.com> | 2024-09-22 17:31:24 +0100 |
|---|---|---|
| committer | Mario Limonciello <superm1@gmail.com> | 2024-10-10 14:33:32 +0000 |
| commit | 8a507494f3febe8f6b4e933fc951fdb16e3932df (patch) | |
| tree | 78352b877da23b8c642718c73903b58ed49c1565 /check_whence.py | |
| parent | 981b1ab77632ca02c790ed87badeb6ceabdef332 (diff) | |
check_whence.py: ban link-to-a-link
Using link-to-a-link reduces legibility and changes to the root link,
also changes the leafs. Where the latter may be undesired and in some
cases just wrong.
We have a couple of instances in-tree, so fix them up and ban the
combination.
One particularly good example, why we'd want this is:
https://gitlab.com/kernel-firmware/linux-firmware/-/merge_requests/272
In there we have the following:
File: ti/tas2781/TAS2XXX1EB30.bin
[snip]
Link: TAS2XXX1EB3.bin -> ti/tas2781/TAS2XXX1EB3.bin
Link: ti/tas2781/TAS2XXX1EB3.bin -> TAS2XXX1EB30.bin
Link: TAS2XXX1EB30.bin -> ti/tas2781/TAS2XXX1EB30.bin
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'check_whence.py')
| -rwxr-xr-x | check_whence.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/check_whence.py b/check_whence.py index c270ee60..d7742f1e 100755 --- a/check_whence.py +++ b/check_whence.py @@ -115,12 +115,20 @@ def main(): sys.stderr.write("E: %s listed in WHENCE as Link, is in tree\n" % name) ret = 1 + invalid_targets = set(link[0] for link in links_list) + for link, target in sorted(links_list): + if target in invalid_targets: + sys.stderr.write( + "E: target %s of link %s is also a link\n" % (target, link) + ) + ret = 1 + for name in sorted(list(known_files - git_files)): sys.stderr.write("E: %s listed in WHENCE does not exist\n" % name) ret = 1 - # A link can point to another link, or to a file... - valid_targets = set(link[0] for link in links_list) | git_files + # A link can point to a file... + valid_targets = set(git_files) # ... or to a directory for target in set(valid_targets): |
