Skip to content

Commit

Permalink
init: fix missing allowerasing flag for dnf
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Jun 29, 2024
1 parent a4b0332 commit 77b37ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,13 @@ setup_dnf()
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! ${manager} install -y "${shell_pkg}"; then
if ! ${manager} install -y "${shell_pkg}" 2> /dev/null; then
shell_pkg="bash"
fi
flags=""
if [ "${manager}" = "dnf" ]; then
flags="--allowerasing"
fi
deps="
${shell_pkg}
bash-completion
Expand Down Expand Up @@ -930,7 +934,7 @@ setup_dnf()
vulkan
"
# shellcheck disable=SC2086,2046
${manager} install -y $(${manager} list -q ${deps} |
${manager} install ${flags} -y $(${manager} list -q ${deps} |
grep -v "Packages" |
grep "$(uname -m)" |
cut -d' ' -f1)
Expand Down

0 comments on commit 77b37ea

Please sign in to comment.