diff --git a/pikaur/install_cli.py b/pikaur/install_cli.py index dd4945e5..219aea23 100644 --- a/pikaur/install_cli.py +++ b/pikaur/install_cli.py @@ -10,6 +10,7 @@ from typing import TYPE_CHECKING from .args import parse_args, reconstruct_args +from .aur import find_aur_packages from .build import PackageBuild, PkgbuildChanged, clone_aur_repos from .config import ( DECORATION, @@ -316,17 +317,19 @@ def _get_pkgbuild_for_name_or_provided(self, pkg_name: str) -> PackageBuild: ) def edit_pkgbuild_during_the_build(self, pkg_name: str) -> None: - if getattr(self, "install_info", None): - updated_pkgbuilds = self._clone_aur_repos([ - install_info - for install_info in ( - self.install_info._all_aur_updates_raw # pylint: disable=protected-access # noqa: SLF001,E501,RUF100 - ) - if install_info.name == pkg_name - ]) - if not updated_pkgbuilds: - return - self.package_builds_by_name.update(updated_pkgbuilds) + install_infos = [ + install_info + for install_info in ( + self.install_info._all_aur_updates_raw # pylint: disable=protected-access # noqa: SLF001,E501,RUF100 + ) + if install_info.name == pkg_name + ] if getattr(self, "install_info", None) else [ + AURInstallInfo(package=find_aur_packages([pkg_name])[0][0]), + ] + updated_pkgbuilds = self._clone_aur_repos(install_infos) + if not updated_pkgbuilds: + return + self.package_builds_by_name.update(updated_pkgbuilds) pkg_build = self._get_pkgbuild_for_name_or_provided(pkg_name) if not edit_file( pkg_build.pkgbuild_path,