Compare commits

..

15 Commits

Author SHA1 Message Date
arcanis 56d5478216 add separate function for symlinks creation 2026-01-19 13:21:28 +02:00
arcanis bb01f72931 fix sttyle 2026-01-16 09:23:13 +02:00
arcanis e2812c071b remove generators 2026-01-16 09:22:36 +02:00
arcanis 9ccff5657b simplify symlionk creation 2026-01-16 09:20:38 +02:00
arcanis 4dd578ce10 drop excess REQUIRES_REPOSITORY 2026-01-16 09:20:38 +02:00
arcanis 49e558e4e6 support requires repostory flag 2026-01-16 09:20:38 +02:00
arcanis 80ed47b4ed gpg loader fix 2026-01-16 09:20:38 +02:00
arcanis 5ee949b5ec regenerate docs 2026-01-16 09:20:38 +02:00
arcanis 61057c9f91 add archive trigger 2026-01-16 09:20:38 +02:00
arcanis 8142a3d797 add archive trigger 2026-01-16 09:20:38 +02:00
arcanis aae536204e lookup through archive packages before build 2026-01-16 09:20:38 +02:00
arcanis 27f5a5f5d1 use generic packages tree for all repos 2026-01-16 09:20:37 +02:00
arcanis 918273c1bb implement atomic_move method, move files only with lock 2026-01-16 09:20:21 +02:00
arcanis c651db85ee write tests to support new changes 2026-01-16 09:20:18 +02:00
arcanis afd62e88f6 store built packages in archive tree instead of repository 2026-01-16 09:18:02 +02:00
4 changed files with 3 additions and 39 deletions
@@ -23,7 +23,6 @@ from ahriman.core.build_tools.sources import Sources
from ahriman.core.exceptions import UnknownPackageError
from ahriman.core.repository.cleaner import Cleaner
from ahriman.core.repository.package_info import PackageInfo
from ahriman.models.build_status import BuildStatusEnum
from ahriman.models.event import EventType
from ahriman.models.package import Package
from ahriman.models.package_source import PackageSource
@@ -72,8 +71,6 @@ class UpdateHandler(PackageInfo, Cleaner):
self.reporter.set_pending(local.base)
self.event(local.base, EventType.PackageOutdated, "Remote version is newer than local")
result.append(remote)
else:
self.reporter.package_status_update(local.base, BuildStatusEnum.Success)
except Exception:
self.reporter.set_failed(local.base)
self.logger.exception("could not load remote package %s", local.base)
@@ -82,8 +79,7 @@ class UpdateHandler(PackageInfo, Cleaner):
def updates_dependencies(self, filter_packages: Iterable[str]) -> list[Package]:
"""
check packages which are required to be rebuilt based on dynamic dependencies
(e.g. linking, modules paths, etc.)
check packages which ae required to be rebuilt based on dynamic dependencies (e.g. linking, modules paths, etc.)
Args:
filter_packages(Iterable[str]): do not check every package just specified in the list
+1 -1
View File
@@ -205,7 +205,7 @@ class Package(LazyLogging):
package = pacman.handle.load_pkg(str(path))
description = PackageDescription.from_package(package, path)
return cls(
base=package.base or package.name,
base=package.base,
version=package.version,
remote=RemoteSource(source=PackageSource.Archive),
packages={package.name: description},
@@ -6,7 +6,6 @@ from typing import Any
from ahriman.core.exceptions import UnknownPackageError
from ahriman.core.repository.update_handler import UpdateHandler
from ahriman.models.build_status import BuildStatusEnum
from ahriman.models.dependencies import Dependencies
from ahriman.models.event import EventType
from ahriman.models.package import Package
@@ -67,20 +66,6 @@ def test_updates_aur_failed(update_handler: UpdateHandler, package_ahriman: Pack
status_client_mock.assert_called_once_with(package_ahriman.base)
def test_updates_aur_up_to_date(update_handler: UpdateHandler, package_ahriman: Package,
mocker: MockerFixture) -> None:
"""
must set success status for packages which are not out-of-dated
"""
mocker.patch("ahriman.core.repository.update_handler.UpdateHandler.packages", return_value=[package_ahriman])
mocker.patch("ahriman.models.package.Package.from_aur", return_value=package_ahriman)
mocker.patch("ahriman.models.package.Package.is_outdated", return_value=False)
status_client_mock = mocker.patch("ahriman.core.status.local_client.LocalClient.package_status_update")
assert update_handler.updates_aur([], vcs=True) == []
status_client_mock.assert_called_once_with(package_ahriman.base, BuildStatusEnum.Success)
def test_updates_aur_local(update_handler: UpdateHandler, package_ahriman: Package,
mocker: MockerFixture) -> None:
"""
+1 -18
View File
@@ -2,7 +2,7 @@ import copy
from pathlib import Path
from pytest_mock import MockerFixture
from unittest.mock import MagicMock, PropertyMock, call as MockCall
from unittest.mock import MagicMock, call as MockCall
from ahriman.core.alpm.pacman import Pacman
from ahriman.core.configuration import Configuration
@@ -163,23 +163,6 @@ def test_from_archive(package_ahriman: Package, pyalpm_handle: MagicMock, mocker
assert generated == package_ahriman
def test_from_archive_empty_base(package_ahriman: Package, pyalpm_package_ahriman: MagicMock,
mocker: MockerFixture) -> None:
"""
must construct package with empty base from alpm library
"""
pyalpm_handle = MagicMock()
type(pyalpm_package_ahriman).base = PropertyMock(return_value=None)
pyalpm_handle.handle.load_pkg.return_value = pyalpm_package_ahriman
mocker.patch("ahriman.models.package_description.PackageDescription.from_package",
return_value=package_ahriman.packages[package_ahriman.base])
generated = Package.from_archive(Path("path"), pyalpm_handle)
generated.remote = package_ahriman.remote
assert generated == package_ahriman
def test_from_aur(package_ahriman: Package, aur_package_ahriman: AURPackage, mocker: MockerFixture) -> None:
"""
must construct package from aur