mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-11-18 22:43:42 +00:00
Compare commits
1 Commits
c734f0815a
...
f54b9ce3e3
| Author | SHA1 | Date | |
|---|---|---|---|
| f54b9ce3e3 |
@ -1,19 +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/>.
|
|
||||||
#
|
|
||||||
@ -1,65 +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 pathlib import Path
|
|
||||||
|
|
||||||
from ahriman.core.configuration import Configuration
|
|
||||||
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 ArchiveRotationTrigger(Trigger):
|
|
||||||
"""
|
|
||||||
archive repository extension
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
paths(RepositoryPaths): repository paths instance
|
|
||||||
"""
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
@property
|
|
||||||
def repos_path(self) -> Path:
|
|
||||||
return self.paths.archive / "repos"
|
|
||||||
|
|
||||||
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
|
|
||||||
"""
|
|
||||||
|
|
||||||
def on_start(self) -> None:
|
|
||||||
"""
|
|
||||||
trigger action which will be called at the start of the application
|
|
||||||
"""
|
|
||||||
with self.paths.preserve_owner(self.repos_path):
|
|
||||||
self.repos_path.mkdir(mode=0o755, exist_ok=True)
|
|
||||||
@ -109,7 +109,6 @@ class Executor(PackageInfo, Cleaner):
|
|||||||
|
|
||||||
loaded_package = Package.from_build(path, self.architecture, None)
|
loaded_package = Package.from_build(path, self.architecture, None)
|
||||||
if prebuilt := list(self._archive_lookup(loaded_package)):
|
if prebuilt := list(self._archive_lookup(loaded_package)):
|
||||||
self.logger.info("using prebuilt packages for %s-%s", loaded_package.base, loaded_package.version)
|
|
||||||
built = []
|
built = []
|
||||||
for artefact in prebuilt:
|
for artefact in prebuilt:
|
||||||
with filelock(artefact):
|
with filelock(artefact):
|
||||||
|
|||||||
Reference in New Issue
Block a user