diff --git a/recipes/msys2/all/conanfile.py b/recipes/msys2/all/conanfile.py index 752c04acf11c3..874364cdbf582 100644 --- a/recipes/msys2/all/conanfile.py +++ b/recipes/msys2/all/conanfile.py @@ -142,7 +142,7 @@ 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"') + self.run(f'bash -l -c "to_remove=$(pacman -Qsq {package}) && pacman -Rs -d -d $to_remove --noconfirm"') self._kill_pacman()