mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
scripts/checkdeps: cleanup
Replace "which" with "command -v", which is part of POSIX. Make offering to install packages contingent on having the sudo command. Not every distro uses sudo. It is optional in Gentoo, for example. Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
parent
df1cffa51e
commit
ef93ecf54b
@ -132,12 +132,13 @@ if [ "${#need[@]}" -gt 0 ]; then
|
|||||||
done
|
done
|
||||||
echo "**** You seem to use a $DISTRO system ****"
|
echo "**** You seem to use a $DISTRO system ****"
|
||||||
|
|
||||||
|
if command -v sudo >/dev/null; then
|
||||||
case "$DISTRO" in
|
case "$DISTRO" in
|
||||||
ubuntu|debian|linuxmint|\"elementary\")
|
ubuntu|debian|linuxmint|\"elementary\")
|
||||||
get_yes_no && sudo apt-get install "${need_pkg[@]}"
|
get_yes_no && sudo apt-get install "${need_pkg[@]}"
|
||||||
;;
|
;;
|
||||||
fedora|centos|rhel)
|
fedora|centos|rhel)
|
||||||
if [ $(which dnf) ]; then YUM=dnf; else YUM=yum; fi
|
command -v dnf >/dev/null && YUM=dnf || YUM=yum
|
||||||
get_yes_no && sudo $YUM install "${need_pkg[@]}"
|
get_yes_no && sudo $YUM install "${need_pkg[@]}"
|
||||||
;;
|
;;
|
||||||
gentoo)
|
gentoo)
|
||||||
@ -160,6 +161,9 @@ if [ "${#need[@]}" -gt 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
echo "The command 'sudo' was not found. Please install necessary packages manually."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
get_deps
|
get_deps
|
||||||
|
Loading…
x
Reference in New Issue
Block a user