From 0255bc025bfbd5275db421bb707bad2e99046364 Mon Sep 17 00:00:00 2001 From: John 'Warthog9' Hawley Date: Fri, 5 Apr 2024 10:07:52 -0700 Subject: [PATCH] Fix: Ignore symlinks in the tree walk Trying to open a symlink directly doesn't go well, and may reference things outside the repository. Assuming that a symlink doesn't need to be independently opened and checked as if the file is in the repository it'll get picked up elsewhere, and this would just be a dupe, or if it's external it's not part of the repository and not entirely useful to check anyway. If it's a symlink, just skip it. Signed-off-by: John 'Warthog9' Hawley --- verify-spdx-headers | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/verify-spdx-headers b/verify-spdx-headers index 58ef007..0f1d86b 100755 --- a/verify-spdx-headers +++ b/verify-spdx-headers @@ -98,6 +98,10 @@ class Index: for file in files: path = os.path.join(root, file) + # If the file is a symlink, don't bother + if os.path.islink( path ): + continue + # Find the language of the file. language = self.language(path) if language is None: