aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2023-03-28 15:43:50 +0300
committerPatrik Teivonen <patrik.teivonen@qt.io>2023-04-05 12:45:44 +0000
commitffed306e3d16ef6ff7d6cdf24457cc9eaa5958ca (patch)
treeaa543c12a88fa4baa83cc324d9b6863065b6b66f
parent812fc07a1063eefb12e4ff2cbb66fdba4fb4ce51 (diff)
sign_installer.py: Ignore symlinks in looking for signable content
Broken symlinks in content fail to resolve Change-Id: I271ce6e3127835ed0c29a06a9cc5e5ed8077efec Reviewed-by: Antti Kokko <antti.kokko@qt.io>
-rwxr-xr-xpackaging-tools/sign_installer.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/packaging-tools/sign_installer.py b/packaging-tools/sign_installer.py
index c70205bff..b396fe427 100755
--- a/packaging-tools/sign_installer.py
+++ b/packaging-tools/sign_installer.py
@@ -110,10 +110,22 @@ def _find_signable_content(pkg_dir: Path) -> Tuple[List[Path], List[Path]]:
Returns:
Lists of paths sorted for codesign and staple operations
"""
+
+ def not_link(path: Path) -> bool:
+ """
+ Check if path is not a symlink
+
+ Args:
+ path: Path to check
+ Returns:
+ True for resolved paths, False for symlinks
+ """
+ return not path.is_symlink()
+
sign_list: List[Path] = []
staple_list: List[Path] = []
for path in sorted(
- set(Path(p).resolve(strict=True) for p in locate_paths(pkg_dir, patterns=["*"])),
+ set(Path(p).resolve() for p in locate_paths(pkg_dir, patterns=["*"], filters=[not_link])),
key=lambda path: len(path.parts), # Sort by path part length
reverse=True, # Nested items first to ensure signing order (important)
):