Skip to content

Commit

Permalink
fix(install_cli: edit_pkgbuild_during_the_build): handle case when in…
Browse files Browse the repository at this point in the history
…stall_info object isn't created yet
  • Loading branch information
actionless committed Dec 29, 2024
1 parent 84cb764 commit 95b9ce0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions pikaur/install_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,17 @@ def _get_pkgbuild_for_name_or_provided(self, pkg_name: str) -> PackageBuild:
)

def edit_pkgbuild_during_the_build(self, pkg_name: str) -> 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)
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)
pkg_build = self._get_pkgbuild_for_name_or_provided(pkg_name)
if not edit_file(
pkg_build.pkgbuild_path,
Expand Down

0 comments on commit 95b9ce0

Please sign in to comment.