makechrootpkg: fix an infinite loop when installing package with -I #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When installing with the
-I
option a package which in turn has a dependency with multiple providers, makechrootpkg enters in an infinite loop. This happens because we are using thepacman -U
command piped withyes y
. Theyes y
command outputs onlyy
lines, but when installing a dependency package with multiple providers pacman expects a number as the input. Being such, makechrootpkg outputs this endlessly:Using the pacman
--noconfirm
option without pipingyes y
fixes the issue.There are other ways to fix it, like piping
while :; do printf "y\n1\n"; done
instead ofyes y
, but simply using--noconfirm
looks simpler and better.Example package to reproduce: flutterAUR (depends on android-sdkAUR). When executing
extra-x86_64-build -- -I /path/to/android-sdk-26.1.1-1-x86_64.pkg.tar.zst
, it will enter in an infinite loop becausejava-environment
(dependency of android-sdkAUR that is being installed with-I
) has multiple providers.