fix: return only built packages from task

Since the last updates makepkg --packagelist also adds debug packages
which causes errors
This commit is contained in:
Evgenii Alekseev 2024-02-09 17:37:50 +02:00
parent 4fec42eac8
commit 01597c531b
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,7 @@ mv dist/ahriman-*.tar.gz package/archlinux
chmod +777 package/archlinux # because fuck you that's why
cd package/archlinux
sudo -u nobody -- makepkg -cf --skipchecksums --noconfirm
sudo -u nobody -- makepkg --packagelist | pacman -U --noconfirm -
sudo -u nobody -- makepkg --packagelist | grep -v -- -debug- | pacman -U --noconfirm -
# create machine-id which is required by build tools
systemd-machine-id-setup

View File

@ -107,7 +107,10 @@ class Task(LazyLogging):
logger=self.logger,
environment=environment,
).splitlines()
return [Path(package) for package in packages]
# some dirty magic here
# the filter is applied in order to make sure that result will only contain packages which were actually built
# e.g. in some cases packagelist command produces debug packages which were not actually built
return list(filter(lambda path: path.is_file(), map(Path, packages)))
def init(self, sources_dir: Path, database: SQLite, local_version: str | None) -> str | None:
"""