mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-01-16 11:13:43 +00:00
Compare commits
4 Commits
feature/tr
...
b4efc4b19d
| Author | SHA1 | Date | |
|---|---|---|---|
| b4efc4b19d | |||
| ea799e402d | |||
| fa5c7b1764 | |||
| 5358ee5222 |
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@ -7,7 +7,6 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
- '!*rc*'
|
- '!*rc*'
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@ -220,7 +220,6 @@ Again, the most checks can be performed by `tox` command, though some additional
|
|||||||
* It is allowed to change web API to add new fields or remove optional ones. However, in case of model changes, new API version must be introduced.
|
* It is allowed to change web API to add new fields or remove optional ones. However, in case of model changes, new API version must be introduced.
|
||||||
* On the other hand, it is allowed to change method signatures, however, it is recommended to add new parameters as optional if possible. Deprecated API can be dropped during major release.
|
* On the other hand, it is allowed to change method signatures, however, it is recommended to add new parameters as optional if possible. Deprecated API can be dropped during major release.
|
||||||
* Enumerations (`Enum` classes) are allowed and recommended. However, it is recommended to use `StrEnum` class if there are from/to string conversions and `IntEnum` otherwise.
|
* Enumerations (`Enum` classes) are allowed and recommended. However, it is recommended to use `StrEnum` class if there are from/to string conversions and `IntEnum` otherwise.
|
||||||
* `Generator` return type is not allowed. Generator functions must return generic `Iterator` object. Documentation should be described as `Yields`, however, because of pylint checks. Unfortunately, `Iterable` return type is not available for generators also, because of specific `contextlib.contextmanager` case.
|
|
||||||
|
|
||||||
### Other checks
|
### Other checks
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
ahriman.core.archive package
|
|
||||||
============================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
ahriman.core.archive.archive\_tree module
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
.. automodule:: ahriman.core.archive.archive_tree
|
|
||||||
:members:
|
|
||||||
:no-undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
ahriman.core.archive.archive\_trigger module
|
|
||||||
--------------------------------------------
|
|
||||||
|
|
||||||
.. automodule:: ahriman.core.archive.archive_trigger
|
|
||||||
:members:
|
|
||||||
:no-undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: ahriman.core.archive
|
|
||||||
:members:
|
|
||||||
:no-undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@ -8,7 +8,6 @@ Subpackages
|
|||||||
:maxdepth: 4
|
:maxdepth: 4
|
||||||
|
|
||||||
ahriman.core.alpm
|
ahriman.core.alpm
|
||||||
ahriman.core.archive
|
|
||||||
ahriman.core.auth
|
ahriman.core.auth
|
||||||
ahriman.core.build_tools
|
ahriman.core.build_tools
|
||||||
ahriman.core.configuration
|
ahriman.core.configuration
|
||||||
|
|||||||
@ -146,8 +146,6 @@ Build related configuration. Group name can refer to architecture, e.g. ``build:
|
|||||||
|
|
||||||
Base repository settings.
|
Base repository settings.
|
||||||
|
|
||||||
* ``architecture`` - repository architecture, string. This field is read-only and generated automatically from run options if possible.
|
|
||||||
* ``name`` - repository name, string. This field is read-only and generated automatically from run options if possible.
|
|
||||||
* ``root`` - root path for application, string, required.
|
* ``root`` - root path for application, string, required.
|
||||||
|
|
||||||
``sign:*`` groups
|
``sign:*`` groups
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
[build]
|
[build]
|
||||||
; List of well-known triggers. Used only for configuration purposes.
|
; List of well-known triggers. Used only for configuration purposes.
|
||||||
triggers_known[] = ahriman.core.archive.ArchiveTrigger
|
|
||||||
triggers_known[] = ahriman.core.distributed.WorkerLoaderTrigger
|
triggers_known[] = ahriman.core.distributed.WorkerLoaderTrigger
|
||||||
triggers_known[] = ahriman.core.distributed.WorkerTrigger
|
triggers_known[] = ahriman.core.distributed.WorkerTrigger
|
||||||
triggers_known[] = ahriman.core.support.KeyringTrigger
|
triggers_known[] = ahriman.core.support.KeyringTrigger
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -66,7 +66,7 @@ class Status(Handler):
|
|||||||
Status.check_status(args.exit_code, packages)
|
Status.check_status(args.exit_code, packages)
|
||||||
|
|
||||||
comparator: Callable[[tuple[Package, BuildStatus]], Comparable] = lambda item: item[0].base
|
comparator: Callable[[tuple[Package, BuildStatus]], Comparable] = lambda item: item[0].base
|
||||||
filter_fn: Callable[[tuple[Package, BuildStatus]], bool] = \
|
filter_fn: Callable[[tuple[Package, BuildStatus]], bool] =\
|
||||||
lambda item: args.status is None or item[1].status == args.status
|
lambda item: args.status is None or item[1].status == args.status
|
||||||
for package, package_status in sorted(filter(filter_fn, packages), key=comparator):
|
for package, package_status in sorted(filter(filter_fn, packages), key=comparator):
|
||||||
PackagePrinter(package, package_status)(verbose=args.info)
|
PackagePrinter(package, package_status)(verbose=args.info)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -52,7 +52,7 @@ class Validate(Handler):
|
|||||||
"""
|
"""
|
||||||
from ahriman.core.configuration.validator import Validator
|
from ahriman.core.configuration.validator import Validator
|
||||||
|
|
||||||
schema = Validate.schema(configuration)
|
schema = Validate.schema(repository_id, configuration)
|
||||||
validator = Validator(configuration=configuration, schema=schema)
|
validator = Validator(configuration=configuration, schema=schema)
|
||||||
|
|
||||||
if validator.validate(configuration.dump()):
|
if validator.validate(configuration.dump()):
|
||||||
@ -83,11 +83,12 @@ class Validate(Handler):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def schema(configuration: Configuration) -> ConfigurationSchema:
|
def schema(repository_id: RepositoryId, configuration: Configuration) -> ConfigurationSchema:
|
||||||
"""
|
"""
|
||||||
get schema with triggers
|
get schema with triggers
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
repository_id(RepositoryId): repository unique identifier
|
||||||
configuration(Configuration): configuration instance
|
configuration(Configuration): configuration instance
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -106,12 +107,12 @@ class Validate(Handler):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# default settings if any
|
# default settings if any
|
||||||
for schema_name, schema in trigger_class.configuration_schema(None).items():
|
for schema_name, schema in trigger_class.configuration_schema(repository_id, None).items():
|
||||||
erased = Validate.schema_erase_required(copy.deepcopy(schema))
|
erased = Validate.schema_erase_required(copy.deepcopy(schema))
|
||||||
root[schema_name] = Validate.schema_merge(root.get(schema_name, {}), erased)
|
root[schema_name] = Validate.schema_merge(root.get(schema_name, {}), erased)
|
||||||
|
|
||||||
# settings according to enabled triggers
|
# settings according to enabled triggers
|
||||||
for schema_name, schema in trigger_class.configuration_schema(configuration).items():
|
for schema_name, schema in trigger_class.configuration_schema(repository_id, configuration).items():
|
||||||
root[schema_name] = Validate.schema_merge(root.get(schema_name, {}), copy.deepcopy(schema))
|
root[schema_name] = Validate.schema_merge(root.get(schema_name, {}), copy.deepcopy(schema))
|
||||||
|
|
||||||
return root
|
return root
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -21,7 +21,7 @@ import argparse
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections.abc import Iterator
|
from collections.abc import Generator
|
||||||
from importlib import metadata
|
from importlib import metadata
|
||||||
from typing import ClassVar
|
from typing import ClassVar
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class Versions(Handler):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def package_dependencies(root: str) -> Iterator[tuple[str, str]]:
|
def package_dependencies(root: str) -> Generator[tuple[str, str], None, None]:
|
||||||
"""
|
"""
|
||||||
extract list of ahriman package dependencies installed into system with their versions
|
extract list of ahriman package dependencies installed into system with their versions
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class Versions(Handler):
|
|||||||
Yields:
|
Yields:
|
||||||
tuple[str, str]: map of installed dependency to its version
|
tuple[str, str]: map of installed dependency to its version
|
||||||
"""
|
"""
|
||||||
def dependencies_by_key(key: str) -> Iterator[str]:
|
def dependencies_by_key(key: str) -> Generator[str, None, None]:
|
||||||
# in importlib it returns requires in the following format
|
# in importlib it returns requires in the following format
|
||||||
# ["pytest (>=3.0.0) ; extra == 'test'", "pytest-cov ; extra == 'test'"]
|
# ["pytest (>=3.0.0) ; extra == 'test'", "pytest-cov ; extra == 'test'"]
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -19,7 +19,7 @@
|
|||||||
#
|
#
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from collections.abc import Iterator
|
from collections.abc import Generator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ahriman.application.handlers.handler import Handler, SubParserAction
|
from ahriman.application.handlers.handler import Handler, SubParserAction
|
||||||
@ -86,7 +86,7 @@ class Web(Handler):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def extract_arguments(args: argparse.Namespace, configuration: Configuration) -> Iterator[str]:
|
def extract_arguments(args: argparse.Namespace, configuration: Configuration) -> Generator[str, None, None]:
|
||||||
"""
|
"""
|
||||||
extract list of arguments used for current command, except for command specific ones
|
extract list of arguments used for current command, except for command specific ones
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -21,7 +21,7 @@ import itertools
|
|||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from collections.abc import Iterable, Iterator
|
from collections.abc import Generator, Iterable
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pyalpm import DB, Handle, Package, SIG_DATABASE_OPTIONAL, SIG_PACKAGE_OPTIONAL # type: ignore[import-not-found]
|
from pyalpm import DB, Handle, Package, SIG_DATABASE_OPTIONAL, SIG_PACKAGE_OPTIONAL # type: ignore[import-not-found]
|
||||||
@ -188,7 +188,7 @@ class Pacman(LazyLogging):
|
|||||||
Returns:
|
Returns:
|
||||||
dict[str, set[str]]: map of package name to its list of files
|
dict[str, set[str]]: map of package name to its list of files
|
||||||
"""
|
"""
|
||||||
def extract(tar: tarfile.TarFile, versions: dict[str, str]) -> Iterator[tuple[str, set[str]]]:
|
def extract(tar: tarfile.TarFile, versions: dict[str, str]) -> Generator[tuple[str, set[str]], None, None]:
|
||||||
for package_name, version in versions.items():
|
for package_name, version in versions.items():
|
||||||
path = Path(f"{package_name}-{version}") / "files"
|
path = Path(f"{package_name}-{version}") / "files"
|
||||||
try:
|
try:
|
||||||
@ -223,7 +223,7 @@ class Pacman(LazyLogging):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def package(self, package_name: str) -> Iterator[Package]:
|
def package(self, package_name: str) -> Generator[Package, None, None]:
|
||||||
"""
|
"""
|
||||||
retrieve list of the packages from the repository by name
|
retrieve list of the packages from the repository by name
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ class Pacman(LazyLogging):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def provided_by(self, package_name: str) -> Iterator[Package]:
|
def provided_by(self, package_name: str) -> Generator[Package, None, None]:
|
||||||
"""
|
"""
|
||||||
search through databases and emit packages which provides the ``package_name``
|
search through databases and emit packages which provides the ``package_name``
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -21,7 +21,7 @@ import itertools
|
|||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
from collections.abc import Iterator
|
from collections.abc import Generator
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ class PkgbuildParser(shlex.shlex):
|
|||||||
Raises:
|
Raises:
|
||||||
PkgbuildParserError: if array is not closed
|
PkgbuildParserError: if array is not closed
|
||||||
"""
|
"""
|
||||||
def extract() -> Iterator[str]:
|
def extract() -> Generator[str, None, None]:
|
||||||
while token := self.get_token():
|
while token := self.get_token():
|
||||||
match token:
|
match token:
|
||||||
case _ if self._is_escaped():
|
case _ if self._is_escaped():
|
||||||
@ -276,7 +276,7 @@ class PkgbuildParser(shlex.shlex):
|
|||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def _parse_token(self, token: str) -> Iterator[PkgbuildPatch]:
|
def _parse_token(self, token: str) -> Generator[PkgbuildPatch, None, None]:
|
||||||
"""
|
"""
|
||||||
parse single token to the PKGBUILD field
|
parse single token to the PKGBUILD field
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ class PkgbuildParser(shlex.shlex):
|
|||||||
|
|
||||||
raise PkgbuildParserError("reached starting position, no valid symbols found")
|
raise PkgbuildParserError("reached starting position, no valid symbols found")
|
||||||
|
|
||||||
def parse(self) -> Iterator[PkgbuildPatch]:
|
def parse(self) -> Generator[PkgbuildPatch, None, None]:
|
||||||
"""
|
"""
|
||||||
parse source stream and yield parsed entries
|
parse source stream and yield parsed entries
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -44,7 +44,7 @@ class AUR(Remote):
|
|||||||
"""
|
"""
|
||||||
generate remote git url from the package base
|
generate remote git url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
repository(str): repository name
|
repository(str): repository name
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class AUR(Remote):
|
|||||||
"""
|
"""
|
||||||
generate remote web url from the package base
|
generate remote web url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -46,7 +46,7 @@ class Official(Remote):
|
|||||||
"""
|
"""
|
||||||
generate remote git url from the package base
|
generate remote git url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
repository(str): repository name
|
repository(str): repository name
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class Official(Remote):
|
|||||||
"""
|
"""
|
||||||
generate remote web url from the package base
|
generate remote web url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -110,7 +110,7 @@ class Remote(SyncHttpClient):
|
|||||||
"""
|
"""
|
||||||
generate remote git url from the package base
|
generate remote git url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
repository(str): repository name
|
repository(str): repository name
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ class Remote(SyncHttpClient):
|
|||||||
"""
|
"""
|
||||||
generate remote web url from the package base
|
generate remote web url from the package base
|
||||||
|
|
||||||
Args:
|
Args
|
||||||
package_base(str): package base
|
package_base(str): package base
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -88,24 +88,22 @@ class Repo(LazyLogging):
|
|||||||
check_output("repo-add", *self.sign_args, str(self.repo_path),
|
check_output("repo-add", *self.sign_args, str(self.repo_path),
|
||||||
cwd=self.root, logger=self.logger, user=self.uid)
|
cwd=self.root, logger=self.logger, user=self.uid)
|
||||||
|
|
||||||
def remove(self, package_name: str | None, filename: Path) -> None:
|
def remove(self, package: str, filename: Path) -> None:
|
||||||
"""
|
"""
|
||||||
remove package from repository
|
remove package from repository
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
package_name(str | None): package name to remove. If none set, it will be guessed from filename
|
package(str): package name to remove
|
||||||
filename(Path): package filename to remove
|
filename(Path): package filename to remove
|
||||||
"""
|
"""
|
||||||
package_name = package_name or filename.name.rsplit("-", maxsplit=3)[0]
|
|
||||||
|
|
||||||
# remove package and signature (if any) from filesystem
|
# remove package and signature (if any) from filesystem
|
||||||
for full_path in self.root.glob(f"**/{filename.name}*"):
|
for full_path in self.root.glob(f"**/{filename.name}*"):
|
||||||
full_path.unlink()
|
full_path.unlink()
|
||||||
|
|
||||||
# remove package from registry
|
# remove package from registry
|
||||||
check_output(
|
check_output(
|
||||||
"repo-remove", *self.sign_args, str(self.repo_path), package_name,
|
"repo-remove", *self.sign_args, str(self.repo_path), package,
|
||||||
exception=BuildError.from_process(package_name),
|
exception=BuildError.from_process(package),
|
||||||
cwd=self.root,
|
cwd=self.root,
|
||||||
logger=self.logger,
|
logger=self.logger,
|
||||||
user=self.uid,
|
user=self.uid,
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2021-2025 ahriman team.
|
|
||||||
#
|
|
||||||
# This file is part of ahriman
|
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
from ahriman.core.archive.archive_trigger import ArchiveTrigger
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2021-2025 ahriman team.
|
|
||||||
#
|
|
||||||
# This file is part of ahriman
|
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from ahriman.core.alpm.repo import Repo
|
|
||||||
from ahriman.core.log import LazyLogging
|
|
||||||
from ahriman.core.utils import utcnow, walk
|
|
||||||
from ahriman.models.package import Package
|
|
||||||
from ahriman.models.repository_paths import RepositoryPaths
|
|
||||||
|
|
||||||
|
|
||||||
class ArchiveTree(LazyLogging):
|
|
||||||
"""
|
|
||||||
wrapper around archive tree
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
paths(RepositoryPaths): repository paths instance
|
|
||||||
repository_id(RepositoryId): repository unique identifier
|
|
||||||
sign_args(list[str]): additional args which have to be used to sign repository archive
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, repository_path: RepositoryPaths, sign_args: list[str]) -> None:
|
|
||||||
"""
|
|
||||||
Args:
|
|
||||||
repository_path(RepositoryPaths): repository paths instance
|
|
||||||
sign_args(list[str]): additional args which have to be used to sign repository archive
|
|
||||||
"""
|
|
||||||
self.paths = repository_path
|
|
||||||
self.repository_id = repository_path.repository_id
|
|
||||||
self.sign_args = sign_args
|
|
||||||
|
|
||||||
def repository_for(self, date: datetime.date | None = None) -> Path:
|
|
||||||
"""
|
|
||||||
get full path to repository at the specified date
|
|
||||||
|
|
||||||
Args:
|
|
||||||
date(datetime.date | None, optional): date to generate path. If none supplied then today will be used
|
|
||||||
(Default value = None)
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Path: path to the repository root
|
|
||||||
"""
|
|
||||||
date = date or utcnow().date()
|
|
||||||
return (
|
|
||||||
self.paths.archive
|
|
||||||
/ "repos"
|
|
||||||
/ date.strftime("%Y")
|
|
||||||
/ date.strftime("%m")
|
|
||||||
/ date.strftime("%d")
|
|
||||||
/ self.repository_id.name
|
|
||||||
/ self.repository_id.architecture
|
|
||||||
)
|
|
||||||
|
|
||||||
def symlinks_create(self, packages: list[Package]) -> None:
|
|
||||||
"""
|
|
||||||
create symlinks for the specified packages in today's repository
|
|
||||||
|
|
||||||
Args:
|
|
||||||
packages(list[Package]): list of packages to be updated
|
|
||||||
"""
|
|
||||||
root = self.repository_for()
|
|
||||||
repo = Repo(self.repository_id.name, self.paths, self.sign_args, root)
|
|
||||||
|
|
||||||
for package in packages:
|
|
||||||
archive = self.paths.archive_for(package.base)
|
|
||||||
|
|
||||||
for package_name, single in package.packages.items():
|
|
||||||
if single.filename is None:
|
|
||||||
self.logger.warning("received empty package filename for %s", package_name)
|
|
||||||
continue
|
|
||||||
|
|
||||||
has_file = False
|
|
||||||
for file in archive.glob(f"{single.filename}*"):
|
|
||||||
symlink = root / file.name
|
|
||||||
try:
|
|
||||||
symlink.symlink_to(file.relative_to(symlink.parent, walk_up=True))
|
|
||||||
has_file = True
|
|
||||||
except FileExistsError:
|
|
||||||
continue # symlink is already created, skip processing
|
|
||||||
|
|
||||||
if has_file:
|
|
||||||
repo.add(root / single.filename)
|
|
||||||
|
|
||||||
def symlinks_fix(self) -> None:
|
|
||||||
"""
|
|
||||||
remove broken symlinks across repositories for all dates
|
|
||||||
"""
|
|
||||||
for path in walk(self.paths.archive / "repos"):
|
|
||||||
root = path.parent
|
|
||||||
*_, name, architecture = root.parts
|
|
||||||
if self.repository_id.name != name or self.repository_id.architecture != architecture:
|
|
||||||
continue # we only process same name repositories
|
|
||||||
|
|
||||||
if not path.is_symlink():
|
|
||||||
continue # find symlinks only
|
|
||||||
if path.exists():
|
|
||||||
continue # filter out not broken symlinks
|
|
||||||
|
|
||||||
Repo(self.repository_id.name, self.paths, self.sign_args, root).remove(None, path)
|
|
||||||
|
|
||||||
def tree_create(self) -> None:
|
|
||||||
"""
|
|
||||||
create repository tree for current repository
|
|
||||||
"""
|
|
||||||
root = self.repository_for()
|
|
||||||
if root.exists():
|
|
||||||
return
|
|
||||||
|
|
||||||
with self.paths.preserve_owner(self.paths.archive):
|
|
||||||
root.mkdir(0o755, parents=True)
|
|
||||||
# init empty repository here
|
|
||||||
Repo(self.repository_id.name, self.paths, self.sign_args, root).init()
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2021-2025 ahriman team.
|
|
||||||
#
|
|
||||||
# This file is part of ahriman
|
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
from ahriman.core.archive.archive_tree import ArchiveTree
|
|
||||||
from ahriman.core.configuration import Configuration
|
|
||||||
from ahriman.core.sign.gpg import GPG
|
|
||||||
from ahriman.core.triggers import Trigger
|
|
||||||
from ahriman.models.package import Package
|
|
||||||
from ahriman.models.repository_id import RepositoryId
|
|
||||||
from ahriman.models.result import Result
|
|
||||||
|
|
||||||
|
|
||||||
class ArchiveTrigger(Trigger):
|
|
||||||
"""
|
|
||||||
archive repository extension
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
paths(RepositoryPaths): repository paths instance
|
|
||||||
tree(ArchiveTree): archive tree wrapper
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, repository_id: RepositoryId, configuration: Configuration) -> None:
|
|
||||||
"""
|
|
||||||
Args:
|
|
||||||
repository_id(RepositoryId): repository unique identifier
|
|
||||||
configuration(Configuration): configuration instance
|
|
||||||
"""
|
|
||||||
Trigger.__init__(self, repository_id, configuration)
|
|
||||||
|
|
||||||
self.paths = configuration.repository_paths
|
|
||||||
self.tree = ArchiveTree(self.paths, GPG(configuration).repository_sign_args)
|
|
||||||
|
|
||||||
def on_result(self, result: Result, packages: list[Package]) -> None:
|
|
||||||
"""
|
|
||||||
run trigger
|
|
||||||
|
|
||||||
Args:
|
|
||||||
result(Result): build result
|
|
||||||
packages(list[Package]): list of all available packages
|
|
||||||
"""
|
|
||||||
self.tree.symlinks_create(packages)
|
|
||||||
|
|
||||||
def on_start(self) -> None:
|
|
||||||
"""
|
|
||||||
trigger action which will be called at the start of the application
|
|
||||||
"""
|
|
||||||
self.tree.tree_create()
|
|
||||||
|
|
||||||
def on_stop(self) -> None:
|
|
||||||
"""
|
|
||||||
trigger action which will be called before the stop of the application
|
|
||||||
"""
|
|
||||||
self.tree.symlinks_fix()
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -19,7 +19,7 @@
|
|||||||
#
|
#
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from collections.abc import Iterator
|
from collections.abc import Generator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import ClassVar
|
from typing import ClassVar
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ class Sources(LazyLogging):
|
|||||||
"""
|
"""
|
||||||
gitconfig = gitconfig or {}
|
gitconfig = gitconfig or {}
|
||||||
|
|
||||||
def configuration_flags() -> Iterator[str]:
|
def configuration_flags() -> Generator[str, None, None]:
|
||||||
for option, value in (self.GITCONFIG | gitconfig).items():
|
for option, value in (self.GITCONFIG | gitconfig).items():
|
||||||
yield "-c"
|
yield "-c"
|
||||||
yield f"{option}=\"{value}\""
|
yield f"{option}=\"{value}\""
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from collections.abc import Iterator
|
from collections.abc import Generator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ahriman.core.build_tools.sources import Sources
|
from ahriman.core.build_tools.sources import Sources
|
||||||
@ -77,7 +77,7 @@ class Task(LazyLogging):
|
|||||||
Returns:
|
Returns:
|
||||||
list[Path]: list of file paths which looks like freshly generated archives
|
list[Path]: list of file paths which looks like freshly generated archives
|
||||||
"""
|
"""
|
||||||
def files() -> Iterator[Path]:
|
def files() -> Generator[Path, None, None]:
|
||||||
for filepath in sources_dir.iterdir():
|
for filepath in sources_dir.iterdir():
|
||||||
if filepath in source_files:
|
if filepath in source_files:
|
||||||
continue # skip files which were already there
|
continue # skip files which were already there
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -43,6 +43,7 @@ class Configuration(configparser.RawConfigParser):
|
|||||||
SYSTEM_CONFIGURATION_PATH(Path): (class attribute) default system configuration path distributed by package
|
SYSTEM_CONFIGURATION_PATH(Path): (class attribute) default system configuration path distributed by package
|
||||||
includes(list[Path]): list of includes which were read
|
includes(list[Path]): list of includes which were read
|
||||||
path(Path | None): path to root configuration file
|
path(Path | None): path to root configuration file
|
||||||
|
repository_id(RepositoryId | None): repository unique identifier
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
Configuration class provides additional method in order to handle application configuration. Since this class is
|
Configuration class provides additional method in order to handle application configuration. Since this class is
|
||||||
@ -93,7 +94,7 @@ class Configuration(configparser.RawConfigParser):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
self._repository_id: RepositoryId | None = None
|
self.repository_id: RepositoryId | None = None
|
||||||
self.path: Path | None = None
|
self.path: Path | None = None
|
||||||
self.includes: list[Path] = []
|
self.includes: list[Path] = []
|
||||||
|
|
||||||
@ -128,32 +129,6 @@ class Configuration(configparser.RawConfigParser):
|
|||||||
"""
|
"""
|
||||||
return self.getpath("settings", "logging")
|
return self.getpath("settings", "logging")
|
||||||
|
|
||||||
@property
|
|
||||||
def repository_id(self) -> RepositoryId | None:
|
|
||||||
"""
|
|
||||||
repository identifier
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
RepositoryId: repository unique identifier
|
|
||||||
"""
|
|
||||||
return self._repository_id
|
|
||||||
|
|
||||||
@repository_id.setter
|
|
||||||
def repository_id(self, repository_id: RepositoryId | None) -> None:
|
|
||||||
"""
|
|
||||||
setter for repository identifier
|
|
||||||
|
|
||||||
Args:
|
|
||||||
repository_id(RepositoryId | None): repository unique identifier
|
|
||||||
"""
|
|
||||||
self._repository_id = repository_id
|
|
||||||
if repository_id is None or repository_id.is_empty:
|
|
||||||
self.remove_option("repository", "name")
|
|
||||||
self.remove_option("repository", "architecture")
|
|
||||||
else:
|
|
||||||
self.set_option("repository", "name", repository_id.name)
|
|
||||||
self.set_option("repository", "architecture", repository_id.architecture)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def repository_name(self) -> str:
|
def repository_name(self) -> str:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -57,7 +57,7 @@ class ConfigurationMultiDict(dict[str, Any]):
|
|||||||
OptionError: if the key already exists in the dictionary, but not a single value list or a string
|
OptionError: if the key already exists in the dictionary, but not a single value list or a string
|
||||||
"""
|
"""
|
||||||
match self.get(key):
|
match self.get(key):
|
||||||
case [current_value] | (str() as current_value):
|
case [current_value] | str(current_value):
|
||||||
value = f"{current_value} {value}"
|
value = f"{current_value} {value}"
|
||||||
case None:
|
case None:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -249,10 +249,6 @@ CONFIGURATION_SCHEMA: ConfigurationSchema = {
|
|||||||
"repository": {
|
"repository": {
|
||||||
"type": "dict",
|
"type": "dict",
|
||||||
"schema": {
|
"schema": {
|
||||||
"architecture": {
|
|
||||||
"type": "string",
|
|
||||||
"empty": False,
|
|
||||||
},
|
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"empty": False,
|
"empty": False,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -21,7 +21,7 @@ import configparser
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections.abc import Iterator, Mapping, MutableMapping
|
from collections.abc import Generator, Mapping, MutableMapping
|
||||||
from string import Template
|
from string import Template
|
||||||
from typing import Any, ClassVar
|
from typing import Any, ClassVar
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class ShellInterpolator(configparser.Interpolation):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_variables(parser: MutableMapping[str, Mapping[str, str]], value: str,
|
def _extract_variables(parser: MutableMapping[str, Mapping[str, str]], value: str,
|
||||||
defaults: Mapping[str, str]) -> Iterator[tuple[str, str]]:
|
defaults: Mapping[str, str]) -> Generator[tuple[str, str], None, None]:
|
||||||
"""
|
"""
|
||||||
extract keys and values (if available) from the configuration. In case if a key is not available, it will be
|
extract keys and values (if available) from the configuration. In case if a key is not available, it will be
|
||||||
silently skipped from the result
|
silently skipped from the result
|
||||||
@ -50,7 +50,7 @@ class ShellInterpolator(configparser.Interpolation):
|
|||||||
Yields:
|
Yields:
|
||||||
tuple[str, str]: variable name used for substitution and its value
|
tuple[str, str]: variable name used for substitution and its value
|
||||||
"""
|
"""
|
||||||
def identifiers() -> Iterator[tuple[str | None, str]]:
|
def identifiers() -> Generator[tuple[str | None, str], None, None]:
|
||||||
# extract all found identifiers and parse them
|
# extract all found identifiers and parse them
|
||||||
for identifier in ShellTemplate(value).get_identifiers():
|
for identifier in ShellTemplate(value).get_identifiers():
|
||||||
match identifier.rsplit(":", maxsplit=1):
|
match identifier.rsplit(":", maxsplit=1):
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -20,7 +20,7 @@
|
|||||||
import fnmatch
|
import fnmatch
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from collections.abc import Iterator, Mapping
|
from collections.abc import Generator, Mapping
|
||||||
from string import Template
|
from string import Template
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class ShellTemplate(Template):
|
|||||||
(self._REPLACE, self._replace, "/"),
|
(self._REPLACE, self._replace, "/"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def generator(variables: dict[str, str]) -> Iterator[tuple[str, str]]:
|
def generator(variables: dict[str, str]) -> Generator[tuple[str, str], None, None]:
|
||||||
for identifier in self.get_identifiers():
|
for identifier in self.get_identifiers():
|
||||||
for regex, function, greediness in substitutions:
|
for regex, function, greediness in substitutions:
|
||||||
if m := regex.match(identifier):
|
if m := regex.match(identifier):
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
@ -109,7 +109,7 @@ class Validator(RootValidator):
|
|||||||
Args:
|
Args:
|
||||||
constraint(list[str]): optional list of allowed special words (e.g. ``localhost``)
|
constraint(list[str]): optional list of allowed special words (e.g. ``localhost``)
|
||||||
field(str): field name to be checked
|
field(str): field name to be checked
|
||||||
value(str): value to be checked
|
value(Path): value to be checked
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
The rule's arguments are validated against this schema:
|
The rule's arguments are validated against this schema:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2021-2026 ahriman team.
|
# Copyright (c) 2021-2025 ahriman team.
|
||||||
#
|
#
|
||||||
# This file is part of ahriman
|
# This file is part of ahriman
|
||||||
# (see https://github.com/arcan1s/ahriman).
|
# (see https://github.com/arcan1s/ahriman).
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user