From: Zbigniew Jędrzejewski-Szmek Date: Thu, 19 Feb 2026 12:01:01 +0000 (+0100) Subject: generate-sym-test: skip everything that is not a file X-Git-Tag: v257.11~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b1feaf6a53ee27155a2e1eb63c5ae74ebe2667;p=thirdparty%2Fsystemd.git generate-sym-test: skip everything that is not a file The generator looks for files in the filesystem, and it sometimes fails on emacs "lock files" which are a symlink. Ignore those. (cherry picked from commit 469879aa44c4cde5541b98be0a4421ab069c5834) (cherry picked from commit 92657eea151b08a7619bc104af373329ed86a5d7) (cherry picked from commit cb27449373c9c19c5b46dcf457658430f1eb72b9) --- diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py index 7b5ded936c6..2b4afff63b8 100755 --- a/src/test/generate-sym-test.py +++ b/src/test/generate-sym-test.py @@ -6,6 +6,7 @@ import os import re import sys +from pathlib import Path from typing import IO @@ -138,7 +139,10 @@ for dirpath, _, filenames in sorted(os.walk(sys.argv[2])): for filename in sorted(filenames): if not filename.endswith('.c') and not filename.endswith('.h'): continue - with open(os.path.join(dirpath, filename), 'r') as f: + p = Path(dirpath) / filename + if p.is_symlink(): + continue + with p.open('rt') as f: process_source_file(f) print(""" {}