Skip to content

Commit

Permalink
makechrootpkg: fix an infinite loop when installing package with -I
Browse files Browse the repository at this point in the history
When installing with the '-I' option a package which in turn has
a dependency with multiple providers, makechrootpkg enters an
infinite loop. This happens because we are using the 'pacman -U'
command piped with 'yes y'. The 'yes y' command outputs only 'y'
lines, but when installing a dependency package with multiple
providers pacman expects a number as the input. Being such,
makechrootpkg outputs this endlessly:

    Enter a number (default=1): error: invalid number: y

Using the pacman '--noconfirm' option without piping 'yes y' fixes
the issue.
  • Loading branch information
dbermond committed Dec 12, 2020
1 parent aff81d3 commit f40c561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion makechrootpkg.in
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ install_packages() {

cp -- "${install_pkgs[@]}" "$copydir/root/"
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
bash -c 'yes y | pacman -U -- "$@"' -bash "${pkgnames[@]/#//root/}"
bash -c 'pacman -U --noconfirm -- "$@"' -bash "${pkgnames[@]/#//root/}"
ret=$?
rm -- "${pkgnames[@]/#/$copydir/root/}"

Expand Down

0 comments on commit f40c561

Please sign in to comment.