From 9e02d7bee862ccf4d022606a25fe4da345effc2a Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Fri, 13 Feb 2026 21:48:36 +0200 Subject: [PATCH] add package like guard to symlinks fix --- src/ahriman/core/archive/archive_tree.py | 4 +++- tests/ahriman/core/archive/test_archive_tree.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ahriman/core/archive/archive_tree.py b/src/ahriman/core/archive/archive_tree.py index 2bf8286b..f4ec810c 100644 --- a/src/ahriman/core/archive/archive_tree.py +++ b/src/ahriman/core/archive/archive_tree.py @@ -24,7 +24,7 @@ from pathlib import Path from ahriman.core.alpm.repo import Repo from ahriman.core.log import LazyLogging -from ahriman.core.utils import symlink_relative, utcnow, walk +from ahriman.core.utils import package_like, symlink_relative, utcnow, walk from ahriman.models.package import Package from ahriman.models.package_description import PackageDescription from ahriman.models.repository_paths import RepositoryPaths @@ -156,6 +156,8 @@ class ArchiveTree(LazyLogging): if self.repository_id.name != name or self.repository_id.architecture != architecture: continue # we only process same name repositories + if not package_like(path): + continue if not path.is_symlink(): continue # find symlinks only if path.exists(): diff --git a/tests/ahriman/core/archive/test_archive_tree.py b/tests/ahriman/core/archive/test_archive_tree.py index 095ff602..c6dc2381 100644 --- a/tests/ahriman/core/archive/test_archive_tree.py +++ b/tests/ahriman/core/archive/test_archive_tree.py @@ -109,6 +109,7 @@ def test_symlinks_fix(archive_tree: ArchiveTree, mocker: MockerFixture) -> None: archive_tree.repository_for() / filename for filename in ( "symlink-1.0.0-1-x86_64.pkg.tar.zst", + "symlink-1.0.0-1-x86_64.pkg.tar.zst.sig", "broken_symlink-1.0.0-1-x86_64.pkg.tar.zst", "file-1.0.0-1-x86_64.pkg.tar.zst", )