From 2f71d66ef7f6bfa93bdc51ab0eaf32cd03a81189 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Mon, 4 Nov 2019 23:16:37 +0000 Subject: [PATCH] tools/makemanifest.py: Follow symlinks when freezing linked directories. While the new manifest.py style got introduced for freezing python code into the resulting binary, the old way - where files and modules within ports/*/modules where baked into the resulting binary - was still supported via `freeze('$(PORT_DIR)/modules')` within manifest.py. However behaviour changed for symlinked directories (=modules), as those links weren't followed anymore. This commit restores the original behaviour by explicitly following symlinks within a modules/ directory --- tools/makemanifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/makemanifest.py b/tools/makemanifest.py index 9889d50750..a3aa42ca41 100644 --- a/tools/makemanifest.py +++ b/tools/makemanifest.py @@ -147,7 +147,7 @@ def get_timestamp(path, default=None): def get_timestamp_newest(path): ts_newest = 0 - for dirpath, dirnames, filenames in os.walk(path): + for dirpath, dirnames, filenames in os.walk(path, followlinks=True): for f in filenames: ts_newest = max(ts_newest, get_timestamp(os.path.join(dirpath, f))) return ts_newest @@ -171,7 +171,7 @@ def freeze_internal(kind, path, script, opt): raise FreezeError('can only freeze one str directory') manifest_list.append((KIND_AS_STR, path, script, opt)) elif script is None: - for dirpath, dirnames, filenames in os.walk(path): + for dirpath, dirnames, filenames in os.walk(path, followlinks=True): for f in filenames: freeze_internal(kind, path, (dirpath + '/' + f)[len(path) + 1:], opt) elif not isinstance(script, str):