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() {
|
package() {
|
||||||
cd "$pkgname"
|
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
|
# python-installer actually thinks that you cannot just copy files to root
|
||||||
# thus we need to copy them manually
|
# thus we need to copy them manually
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{#simplified version of full report#}
|
{#simplified version of full report#}
|
||||||
<b>{{ repository }} update</b>
|
<b>{{ repository }} update</b>
|
||||||
{% for package in packages %}
|
{% for package in packages %}
|
||||||
<a href="{{ link_path }}/{{ package.filename }}">{{ package.name }}</a> {{ package.version }} at {{ package.build_date }}
|
<a href="{{ link_path }}/{{ package.filename }}">{{ package.name }}</a> {{ package.version }}{% endfor %}
|
||||||
{% endfor %}
|
|
@ -101,7 +101,7 @@ class JinjaTemplate:
|
|||||||
"name": package,
|
"name": package,
|
||||||
"url": properties.url or "",
|
"url": properties.url or "",
|
||||||
"version": base.version
|
"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"]
|
comparator: Callable[[Dict[str, str]], str] = lambda item: item["filename"]
|
||||||
|
|
||||||
|
@ -19,14 +19,11 @@
|
|||||||
#
|
#
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import shutil
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Iterable, List, Set, Type
|
from typing import Iterable, List, Set, Type
|
||||||
|
|
||||||
from ahriman.core.build_tools.sources import Sources
|
from ahriman.core.build_tools.sources import Sources
|
||||||
from ahriman.core.database.sqlite import SQLite
|
from ahriman.core.database.sqlite import SQLite
|
||||||
|
from ahriman.core.util import tmpdir
|
||||||
from ahriman.models.package import Package
|
from ahriman.models.package import Package
|
||||||
|
|
||||||
|
|
||||||
@ -61,12 +58,9 @@ class Leaf:
|
|||||||
:param database: database instance
|
:param database: database instance
|
||||||
:return: loaded class
|
:return: loaded class
|
||||||
"""
|
"""
|
||||||
clone_dir = Path(tempfile.mkdtemp())
|
with tmpdir() as clone_dir:
|
||||||
try:
|
|
||||||
Sources.load(clone_dir, package.git_url, database.patches_get(package.base))
|
Sources.load(clone_dir, package.git_url, database.patches_get(package.base))
|
||||||
dependencies = Package.dependencies(clone_dir)
|
dependencies = Package.dependencies(clone_dir)
|
||||||
finally:
|
|
||||||
shutil.rmtree(clone_dir, ignore_errors=True)
|
|
||||||
return cls(package, dependencies)
|
return cls(package, dependencies)
|
||||||
|
|
||||||
def is_root(self, packages: Iterable[Leaf]) -> bool:
|
def is_root(self, packages: Iterable[Leaf]) -> bool:
|
||||||
|
@ -62,13 +62,6 @@ class Result:
|
|||||||
"""
|
"""
|
||||||
return list(self._success.values())
|
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:
|
def add_failed(self, package: Package) -> None:
|
||||||
"""
|
"""
|
||||||
add new package to failed built
|
add new package to failed built
|
||||||
|
Loading…
Reference in New Issue
Block a user