mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-01 08:05:48 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b7d481858d | |||
f753563804 | |||
4727894349 | |||
4b98b21a70 |
@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Evgeniy Alekseev
|
# Maintainer: Evgeniy Alekseev
|
||||||
|
|
||||||
pkgname='ahriman'
|
pkgname='ahriman'
|
||||||
pkgver=0.11.5
|
pkgver=0.11.6
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="ArcHlinux ReposItory MANager"
|
pkgdesc="ArcHlinux ReposItory MANager"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
@ -23,7 +23,7 @@ optdepends=('aws-cli: sync to s3'
|
|||||||
source=("https://github.com/arcan1s/ahriman/releases/download/$pkgver/$pkgname-$pkgver-src.tar.xz"
|
source=("https://github.com/arcan1s/ahriman/releases/download/$pkgver/$pkgname-$pkgver-src.tar.xz"
|
||||||
'ahriman.sysusers'
|
'ahriman.sysusers'
|
||||||
'ahriman.tmpfiles')
|
'ahriman.tmpfiles')
|
||||||
sha512sums=('f81de308af2d462e4904b143808bd4f22c5479fc2ac56c6a6f562be08816d97ddc6daae0b453db98cbc236ce0abad4100f2ae4729a7444a16fbf4b61b2b7d655'
|
sha512sums=('89860693f9a3e6aeb675f571f19366712d65d124879745d89696f8c3d642ef3a468dd0f4a508800dead1c14705c52324c61dad09b7d9e6b9030baa6ee0f86a11'
|
||||||
'13718afec2c6786a18f0b223ef8e58dccf0688bca4cdbe203f14071f5031ed20120eb0ce38b52c76cfd6e8b6581a9c9eaa2743eb11abbaca637451a84c33f075'
|
'13718afec2c6786a18f0b223ef8e58dccf0688bca4cdbe203f14071f5031ed20120eb0ce38b52c76cfd6e8b6581a9c9eaa2743eb11abbaca637451a84c33f075'
|
||||||
'55b20f6da3d66e7bbf2add5d95a3b60632df121717d25a993e56e737d14f51fe063eb6f1b38bd81cc32e05db01c0c1d80aaa720c45cde87f238d8b46cdb8cbc4')
|
'55b20f6da3d66e7bbf2add5d95a3b60632df121717d25a993e56e737d14f51fe063eb6f1b38bd81cc32e05db01c0c1d80aaa720c45cde87f238d8b46cdb8cbc4')
|
||||||
backup=('etc/ahriman.ini'
|
backup=('etc/ahriman.ini'
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="root">
|
<div class="root">
|
||||||
<h1>ahriman {{ version|e }}</h1>
|
<h1>ahriman {{ version|e }} ({{ architecture|e }})</h1>
|
||||||
|
|
||||||
{% include "search-line.jinja2" %}
|
{% include "search-line.jinja2" %}
|
||||||
|
|
||||||
@ -21,7 +21,6 @@
|
|||||||
<th>package base</th>
|
<th>package base</th>
|
||||||
<th>packages</th>
|
<th>packages</th>
|
||||||
<th>version</th>
|
<th>version</th>
|
||||||
<th>architecture</th>
|
|
||||||
<th>last update</th>
|
<th>last update</th>
|
||||||
<th>status</th>
|
<th>status</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -31,7 +30,6 @@
|
|||||||
<td class="include-search"><a href="{{ package.web_url|e }}" title="{{ package.base|e }}">{{ package.base|e }}</a></td>
|
<td class="include-search"><a href="{{ package.web_url|e }}" title="{{ package.base|e }}">{{ package.base|e }}</a></td>
|
||||||
<td class="include-search">{{ package.packages|join("<br>"|safe) }}</td>
|
<td class="include-search">{{ package.packages|join("<br>"|safe) }}</td>
|
||||||
<td>{{ package.version|e }}</td>
|
<td>{{ package.version|e }}</td>
|
||||||
<td>{{ architecture|e }}</td>
|
|
||||||
<td>{{ package.timestamp|e }}</td>
|
<td>{{ package.timestamp|e }}</td>
|
||||||
<td class="package-{{ package.status|e }}">{{ package.status|e }}</td>
|
<td class="package-{{ package.status|e }}">{{ package.status|e }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -33,14 +33,12 @@
|
|||||||
<tr class="header">
|
<tr class="header">
|
||||||
<th>package</th>
|
<th>package</th>
|
||||||
<th>version</th>
|
<th>version</th>
|
||||||
<th>architecture</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% for package in packages %}
|
{% for package in packages %}
|
||||||
<tr class="package">
|
<tr class="package">
|
||||||
<td class="include-search"><a href="{{ link_path|e }}/{{ package.filename|e }}" title="{{ package.name|e }}">{{ package.name|e }}</a></td>
|
<td class="include-search"><a href="{{ link_path|e }}/{{ package.filename|e }}" title="{{ package.name|e }}">{{ package.name|e }}</a></td>
|
||||||
<td>{{ package.version|e }}</td>
|
<td>{{ package.version|e }}</td>
|
||||||
<td>{{ architecture|e }}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--color-building: 250, 255, 146;
|
--color-building: 255, 255, 146;
|
||||||
--color-failed: 255, 94, 94;
|
--color-failed: 255, 94, 94;
|
||||||
--color-pending: 250, 255, 146;
|
--color-pending: 255, 255, 146;
|
||||||
--color-success: 121, 255, 94;
|
--color-success: 94, 255, 94;
|
||||||
--color-unknown: 197, 197, 197;
|
--color-unknown: 225, 225, 225;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes blink-building {
|
@keyframes blink-building {
|
||||||
@ -47,7 +47,11 @@
|
|||||||
background-color: rgba(235, 235, 255, 1);
|
background-color: rgba(235, 235, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.header, tr.package:hover {
|
tr.package:hover {
|
||||||
|
background-color: rgba(255, 255, 225, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.header{
|
||||||
background-color: rgba(200, 200, 255, 1);
|
background-color: rgba(200, 200, 255, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,5 +113,5 @@ if __name__ == '__main__':
|
|||||||
parser.print_help()
|
parser.print_help()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
with Lock(args.lock, args.force):
|
with Lock(args.lock, args.architecture, args.force):
|
||||||
args.fn(args)
|
args.fn(args)
|
||||||
|
@ -17,28 +17,33 @@
|
|||||||
# 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 __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import Optional
|
from types import TracebackType
|
||||||
|
from typing import Literal, Optional, Type
|
||||||
|
|
||||||
from ahriman.core.exceptions import DuplicateRun
|
from ahriman.core.exceptions import DuplicateRun
|
||||||
|
|
||||||
|
|
||||||
class Lock:
|
class Lock:
|
||||||
|
|
||||||
def __init__(self, path: Optional[str], force: bool) -> None:
|
def __init__(self, path: Optional[str], architecture: str, force: bool) -> None:
|
||||||
self.path = path
|
self.path = f'{path}_{architecture}' if path is not None else None
|
||||||
self.force = force
|
self.force = force
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self) -> Lock:
|
||||||
if self.force:
|
if self.force:
|
||||||
self.remove()
|
self.remove()
|
||||||
self.check()
|
self.check()
|
||||||
self.create()
|
self.create()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
def __exit__(self, exc_type: Optional[Type[Exception]], exc_val: Optional[Exception],
|
||||||
|
exc_tb: TracebackType) -> Literal[False]:
|
||||||
self.remove()
|
self.remove()
|
||||||
|
return False
|
||||||
|
|
||||||
def check(self) -> None:
|
def check(self) -> None:
|
||||||
if self.path is None:
|
if self.path is None:
|
||||||
|
@ -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 pyalpm import Handle
|
from pyalpm import Handle # type: ignore
|
||||||
from typing import List, Set
|
from typing import List, Set
|
||||||
|
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
|
@ -20,11 +20,10 @@
|
|||||||
import jinja2
|
import jinja2
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import Dict, Iterable
|
from typing import Callable, Dict, Iterable
|
||||||
|
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.core.report.report import Report
|
from ahriman.core.report.report import Report
|
||||||
from ahriman.core.util import package_like
|
|
||||||
from ahriman.models.package import Package
|
from ahriman.models.package import Package
|
||||||
from ahriman.models.sign_settings import SignSettings
|
from ahriman.models.sign_settings import SignSettings
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ class HTML(Report):
|
|||||||
|
|
||||||
def __init__(self, architecture: str, config: Configuration) -> None:
|
def __init__(self, architecture: str, config: Configuration) -> None:
|
||||||
Report.__init__(self, architecture, config)
|
Report.__init__(self, architecture, config)
|
||||||
self.architecture = architecture
|
|
||||||
section = config.get_section_name('html', architecture)
|
section = config.get_section_name('html', architecture)
|
||||||
self.report_path = config.get(section, 'path')
|
self.report_path = config.get(section, 'path')
|
||||||
self.link_path = config.get(section, 'link_path')
|
self.link_path = config.get(section, 'link_path')
|
||||||
@ -61,14 +59,14 @@ class HTML(Report):
|
|||||||
'version': base.version
|
'version': base.version
|
||||||
} for base in packages for package, filename in base.packages.items()
|
} for base in packages for package, filename in base.packages.items()
|
||||||
]
|
]
|
||||||
|
comparator: Callable[[Dict[str, str]], str] = lambda item: item['filename']
|
||||||
|
|
||||||
html = template.render(
|
html = template.render(
|
||||||
architecture=self.architecture,
|
|
||||||
homepage=self.homepage,
|
homepage=self.homepage,
|
||||||
link_path=self.link_path,
|
link_path=self.link_path,
|
||||||
has_package_signed=SignSettings.SignPackages in self.sign_targets,
|
has_package_signed=SignSettings.SignPackages in self.sign_targets,
|
||||||
has_repo_signed=SignSettings.SignRepository in self.sign_targets,
|
has_repo_signed=SignSettings.SignRepository in self.sign_targets,
|
||||||
packages= sorted(content, key=lambda item: item['filename']),
|
packages=sorted(content, key=comparator),
|
||||||
pgp_key=self.pgp_key,
|
pgp_key=self.pgp_key,
|
||||||
repository=self.repository)
|
repository=self.repository)
|
||||||
|
|
||||||
|
@ -56,13 +56,17 @@ class Leaf:
|
|||||||
self.package = package
|
self.package = package
|
||||||
self.dependencies: Set[str] = set()
|
self.dependencies: Set[str] = set()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def items(self) -> Iterable[str]:
|
||||||
|
return self.package.packages.keys()
|
||||||
|
|
||||||
def is_root(self, packages: Iterable[Leaf]) -> bool:
|
def is_root(self, packages: Iterable[Leaf]) -> bool:
|
||||||
'''
|
'''
|
||||||
:param packages:
|
:param packages:
|
||||||
:return: true if any of packages is dependency of the leaf, false otherwise
|
:return: true if any of packages is dependency of the leaf, false otherwise
|
||||||
'''
|
'''
|
||||||
for leaf in packages:
|
for leaf in packages:
|
||||||
if self.dependencies.intersection(leaf.package.packages.keys()):
|
if self.dependencies.intersection(leaf.items):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ from typing import Optional
|
|||||||
|
|
||||||
|
|
||||||
def check_output(*args: str, exception: Optional[Exception],
|
def check_output(*args: str, exception: Optional[Exception],
|
||||||
cwd = None, stderr: int = subprocess.STDOUT,
|
cwd: Optional[str] = None, stderr: int = subprocess.STDOUT,
|
||||||
logger: Optional[Logger] = None) -> str:
|
logger: Optional[Logger] = None) -> str:
|
||||||
try:
|
try:
|
||||||
result = subprocess.check_output(args, cwd=cwd, stderr=stderr).decode('utf8').strip()
|
result = subprocess.check_output(args, cwd=cwd, stderr=stderr).decode('utf8').strip()
|
||||||
|
@ -19,13 +19,14 @@
|
|||||||
#
|
#
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import aur
|
import aur # type: ignore
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from srcinfo.parse import parse_srcinfo
|
from pyalpm import vercmp # type: ignore
|
||||||
|
from srcinfo.parse import parse_srcinfo # type: ignore
|
||||||
from typing import Dict, List, Optional, Set, Type
|
from typing import Dict, List, Optional, Set, Type
|
||||||
|
|
||||||
from ahriman.core.alpm.pacman import Pacman
|
from ahriman.core.alpm.pacman import Pacman
|
||||||
@ -137,5 +138,5 @@ class Package:
|
|||||||
|
|
||||||
def is_outdated(self, remote: Package) -> bool:
|
def is_outdated(self, remote: Package) -> bool:
|
||||||
remote_version = remote.actual_version() # either normal version or updated VCS
|
remote_version = remote.actual_version() # either normal version or updated VCS
|
||||||
result = check_output('vercmp', self.version, remote_version, exception=None)
|
result: int = vercmp(self.version, remote_version)
|
||||||
return True if int(result) < 0 else False
|
return result < 0
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
# 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/>.
|
||||||
#
|
#
|
||||||
__version__ = '0.11.5'
|
__version__ = '0.11.6'
|
@ -17,15 +17,19 @@
|
|||||||
# 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 aiohttp.web import middleware, Request, Response
|
from aiohttp.web import middleware, Request
|
||||||
from aiohttp.web_exceptions import HTTPClientError
|
from aiohttp.web_exceptions import HTTPClientError
|
||||||
|
from aiohttp.web_response import StreamResponse
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
from typing import Callable
|
from typing import Awaitable, Callable
|
||||||
|
|
||||||
|
|
||||||
def exception_handler(logger: Logger) -> Callable:
|
HandlerType = Callable[[Request], Awaitable[StreamResponse]]
|
||||||
|
|
||||||
|
|
||||||
|
def exception_handler(logger: Logger) -> Callable[[Request, HandlerType], Awaitable[StreamResponse]]:
|
||||||
@middleware
|
@middleware
|
||||||
async def handle(request: Request, handler: Callable) -> Response:
|
async def handle(request: Request, handler: HandlerType) -> StreamResponse:
|
||||||
try:
|
try:
|
||||||
return await handler(request)
|
return await handler(request)
|
||||||
except HTTPClientError:
|
except HTTPClientError:
|
||||||
|
@ -27,4 +27,5 @@ class BaseView(View):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def service(self) -> Watcher:
|
def service(self) -> Watcher:
|
||||||
return self.request.app['watcher']
|
watcher: Watcher = self.request.app['watcher']
|
||||||
|
return watcher
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
# 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 aiohttp_jinja2 import template
|
import aiohttp_jinja2 # type: ignore
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
import ahriman.version as version
|
import ahriman.version as version
|
||||||
@ -27,7 +28,7 @@ from ahriman.web.views.base import BaseView
|
|||||||
|
|
||||||
class IndexView(BaseView):
|
class IndexView(BaseView):
|
||||||
|
|
||||||
@template("build-status.jinja2")
|
@aiohttp_jinja2.template("build-status.jinja2") # type: ignore
|
||||||
async def get(self) -> Dict[str, Any]:
|
async def get(self) -> Dict[str, Any]:
|
||||||
# some magic to make it jinja-friendly
|
# some magic to make it jinja-friendly
|
||||||
packages = [
|
packages = [
|
||||||
|
@ -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/>.
|
||||||
#
|
#
|
||||||
import aiohttp_jinja2
|
import aiohttp_jinja2 # type: ignore
|
||||||
import jinja2
|
import jinja2
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user