Skip to content

Commit

Permalink
msys2: Check if package exists before removing it (#25973)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspam authored Nov 19, 2024
1 parent 58e22c8 commit 6aeda9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/msys2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def _do_build(self):
for package in packages:
self.run(f'bash -l -c "pacman -S {package} --noconfirm"')
for package in ['pkgconf']:
self.run(f'bash -l -c "pacman -Rs -d -d $(pacman -Qsq {package}) --noconfirm"')
if self.run(f'bash -l -c "pacman -Qq {package}"', ignore_errors=True, quiet=True) == 0:
self.run(f'bash -l -c "pacman -Rs -d -d {package} --noconfirm"')

self._kill_pacman()

Expand Down

0 comments on commit 6aeda9d

Please sign in to comment.