mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 19:03:38 +00:00
add package like guard to symlinks fix
This commit is contained in:
@@ -24,7 +24,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
from ahriman.core.alpm.repo import Repo
|
from ahriman.core.alpm.repo import Repo
|
||||||
from ahriman.core.log import LazyLogging
|
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 import Package
|
||||||
from ahriman.models.package_description import PackageDescription
|
from ahriman.models.package_description import PackageDescription
|
||||||
from ahriman.models.repository_paths import RepositoryPaths
|
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:
|
if self.repository_id.name != name or self.repository_id.architecture != architecture:
|
||||||
continue # we only process same name repositories
|
continue # we only process same name repositories
|
||||||
|
|
||||||
|
if not package_like(path):
|
||||||
|
continue
|
||||||
if not path.is_symlink():
|
if not path.is_symlink():
|
||||||
continue # find symlinks only
|
continue # find symlinks only
|
||||||
if path.exists():
|
if path.exists():
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ def test_symlinks_fix(archive_tree: ArchiveTree, mocker: MockerFixture) -> None:
|
|||||||
archive_tree.repository_for() / filename
|
archive_tree.repository_for() / filename
|
||||||
for filename in (
|
for filename in (
|
||||||
"symlink-1.0.0-1-x86_64.pkg.tar.zst",
|
"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",
|
"broken_symlink-1.0.0-1-x86_64.pkg.tar.zst",
|
||||||
"file-1.0.0-1-x86_64.pkg.tar.zst",
|
"file-1.0.0-1-x86_64.pkg.tar.zst",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user