aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuerg Haefliger <juerg.haefliger@canonical.com>2024-02-02 15:41:02 +0100
committerJeff Kirsher <jkirsher@lightfleet.com>2024-04-09 18:18:28 -0700
commit9ea28a2e18a8fc8cba40c77c182f92426f936423 (patch)
tree737d39fdcaa3bd7498cfcbfb5d9e0c1ea9a802be
parentc6ccc4b8a762f1e42174fbc147fb2cd454e1d420 (diff)
downloadfirmware-9ea28a2e18a8fc8cba40c77c182f92426f936423.tar.gz
check_whence: Add a check for duplicate link entries
Verify that there a no duplicate 'Link:' entries in the WHENCE file. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
-rwxr-xr-xcheck_whence.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/check_whence.py b/check_whence.py
index 4b5471e0..fd74a56a 100755
--- a/check_whence.py
+++ b/check_whence.py
@@ -70,6 +70,7 @@ def main():
whence_list = list(list_whence())
whence_files = list(list_whence_files())
links_list = list(list_links_list())
+ whence_links = list(zip(*links_list))[0]
known_files = set(name for name in whence_list if not name.endswith("/")) | set(
[
".gitignore",
@@ -102,6 +103,10 @@ def main():
sys.stderr.write("E: %s listed in WHENCE twice\n" % name)
ret = 1
+ for name in set(link for link in whence_links if whence_links.count(link) > 1):
+ sys.stderr.write("E: %s listed in WHENCE twice\n" % name)
+ ret = 1
+
for name in set(link for link in whence_files if os.path.islink(link)):
sys.stderr.write("E: %s listed in WHENCE as File, but is a symlink\n" % name)
ret = 1