mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
scripts/checkdeps improvements
- when available, use etc/os-release - on debian/ubuntu do not require aptitude
This commit is contained in:
parent
456c875268
commit
d690ffa4de
@ -77,62 +77,42 @@ if [ -n "$need" ]; then
|
|||||||
echo $need
|
echo $need
|
||||||
|
|
||||||
if [ -f /etc/lsb-release ]; then
|
if [ -f /etc/lsb-release ]; then
|
||||||
DISTRO=$(grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2)
|
DISTRO=$(grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2 | tr A-Z a-z)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DISTRO" = "Ubuntu" ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
echo "**** You seem to use a $DISTRO system ****"
|
DISTRO=$(grep ^ID= /etc/os-release | cut -d "=" -f 2 | tr A-Z a-z)
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
fi
|
||||||
if ( ! [ -z "`which aptitude 2>/dev/null`" ] && [ "$ans" = "y" ]); then
|
|
||||||
sudo aptitude install $need_pkg
|
echo "**** You seem to use a $DISTRO system ****"
|
||||||
elif [ "$ans" = "y" ]; then
|
|
||||||
echo "**** The recommended Package-Manager Aptitude is not installed"
|
case "$DISTRO" in
|
||||||
read -p "(y) install Aptitude :: (n) use APT " ans
|
ubuntu|debian)
|
||||||
|
read -p "would you like to install the needed tools ? (y/n) " ans
|
||||||
if [ "$ans" = "y" ]; then
|
if [ "$ans" = "y" ]; then
|
||||||
sudo apt-get -y install aptitude
|
|
||||||
sudo aptitude install $need_pkg
|
|
||||||
elif [ "$ans" = "n" ]; then
|
|
||||||
sudo apt-get install $need_pkg
|
sudo apt-get install $need_pkg
|
||||||
else
|
else
|
||||||
echo "********"
|
echo "********"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
;;
|
||||||
echo "********"
|
fedora|centos|rhel)
|
||||||
|
read -p "would you like to install the needed tools ? (y/n) " ans
|
||||||
|
[ "$ans" = "y" ] && sudo yum install $need_pkg
|
||||||
|
;;
|
||||||
|
gentoo)
|
||||||
|
read -p "would you like to install the needed tools ? (y/n) " ans
|
||||||
|
[ "$ans" = "y" ] && sudo emerge -D $need_pkg
|
||||||
|
;;
|
||||||
|
mageia)
|
||||||
|
read -p "would you like to install the needed tools ? (y/n) " ans
|
||||||
|
[ "$ans" = "y" ] && sudo urpmi $need_pkg
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "**** unsupported distro $DISTRO ****"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
elif ( ! [ -z "`which aptitude 2>/dev/null`" ]); then
|
esac
|
||||||
DISTRO="a Debian"
|
|
||||||
echo "**** You seem to use $DISTRO system ****"
|
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
|
||||||
if ([ "$ans" = "y" ] && ! [ $(sudo -n uptime 2>&1|grep "load"|wc -l) ]); then
|
|
||||||
sudo aptitude install $need_pkg
|
|
||||||
elif [ "$ans" = "y" ]; then
|
|
||||||
su -c "aptitude install $need_pkg"
|
|
||||||
else
|
|
||||||
echo "********"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
elif [ -f /etc/mandrake-release -a -n "`which urpmi 2>/dev/null`" ]; then
|
|
||||||
echo "**** You seem to use a mandrake system ****"
|
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
|
||||||
[ "$ans" = "y" ] && sudo urpmi $need_pkg
|
|
||||||
elif [ -f /etc/gentoo-release -a -n "`which emerge 2>/dev/null`" ]; then
|
|
||||||
echo "**** You seem to use a gentoo system ****"
|
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
|
||||||
[ "$ans" = "y" ] && sudo emerge -D $need_pkg
|
|
||||||
elif [ -f /etc/fedora-release -a -n "`which yum 2>/dev/null`" ]; then
|
|
||||||
echo "**** You seem to use a fedora system ****"
|
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
|
||||||
[ "$ans" = "y" ] && sudo yum install $need_pkg
|
|
||||||
elif [ -f /etc/redhat-release -a "`which yum 2>/dev/null`" ]; then
|
|
||||||
echo "**** You seem to use a RedHat or clone (CentOS) system ****"
|
|
||||||
read -p "would you like to install the needed tools ? (y/n) " ans
|
|
||||||
[ "$ans" = "y" ] && sudo yum install $need_pkg
|
|
||||||
else
|
|
||||||
echo "********"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user