mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 07:17:17 +00:00
do not render failed packages in jinja (#57)
basic templates require package info which is unavailable if package wasn't built
This commit is contained in:
parent
53df735eb2
commit
25734876de
@ -38,7 +38,7 @@ build() {
|
||||
package() {
|
||||
cd "$pkgname"
|
||||
|
||||
python -m installer --destdir="$pkgdir" dist/*.whl
|
||||
python -m installer --destdir="$pkgdir" "dist/$pkgname-$pkgver-py3-none-any.whl"
|
||||
|
||||
# python-installer actually thinks that you cannot just copy files to root
|
||||
# thus we need to copy them manually
|
||||
|
@ -1,5 +1,4 @@
|
||||
{#simplified version of full report#}
|
||||
<b>{{ repository }} update</b>
|
||||
{% for package in packages %}
|
||||
<a href="{{ link_path }}/{{ package.filename }}">{{ package.name }}</a> {{ package.version }} at {{ package.build_date }}
|
||||
{% endfor %}
|
||||
<a href="{{ link_path }}/{{ package.filename }}">{{ package.name }}</a> {{ package.version }}{% endfor %}
|
@ -101,7 +101,7 @@ class JinjaTemplate:
|
||||
"name": package,
|
||||
"url": properties.url or "",
|
||||
"version": base.version
|
||||
} for base in result.updated for package, properties in base.packages.items()
|
||||
} for base in result.success for package, properties in base.packages.items()
|
||||
]
|
||||
comparator: Callable[[Dict[str, str]], str] = lambda item: item["filename"]
|
||||
|
||||
|
@ -19,14 +19,11 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Iterable, List, Set, Type
|
||||
|
||||
from ahriman.core.build_tools.sources import Sources
|
||||
from ahriman.core.database.sqlite import SQLite
|
||||
from ahriman.core.util import tmpdir
|
||||
from ahriman.models.package import Package
|
||||
|
||||
|
||||
@ -61,12 +58,9 @@ class Leaf:
|
||||
:param database: database instance
|
||||
:return: loaded class
|
||||
"""
|
||||
clone_dir = Path(tempfile.mkdtemp())
|
||||
try:
|
||||
with tmpdir() as clone_dir:
|
||||
Sources.load(clone_dir, package.git_url, database.patches_get(package.base))
|
||||
dependencies = Package.dependencies(clone_dir)
|
||||
finally:
|
||||
shutil.rmtree(clone_dir, ignore_errors=True)
|
||||
return cls(package, dependencies)
|
||||
|
||||
def is_root(self, packages: Iterable[Leaf]) -> bool:
|
||||
|
@ -62,13 +62,6 @@ class Result:
|
||||
"""
|
||||
return list(self._success.values())
|
||||
|
||||
@property
|
||||
def updated(self) -> List[Package]:
|
||||
"""
|
||||
:return: list of updated packages inclding both success and failed
|
||||
"""
|
||||
return self.success + self.failed
|
||||
|
||||
def add_failed(self, package: Package) -> None:
|
||||
"""
|
||||
add new package to failed built
|
||||
|
Loading…
Reference in New Issue
Block a user