mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
Merge pull request #2318 from christophgysin/checkdeps
refactoring checkdeps
This commit is contained in:
commit
1c7b4786a3
@ -27,15 +27,19 @@ get_deps() {
|
|||||||
for i in "${!deps[@]}"; do
|
for i in "${!deps[@]}"; do
|
||||||
dep=${deps[$i]}
|
dep=${deps[$i]}
|
||||||
dep_pkg=${deps_pkg[$i]}
|
dep_pkg=${deps_pkg[$i]}
|
||||||
[ -z "$(which $dep 2>/dev/null)" ] && need+=($dep) && need_pkg+=("$dep_pkg")
|
if ! command -v "$dep" >/dev/null; then
|
||||||
|
need+=($dep)
|
||||||
|
need_pkg+=("$dep_pkg")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in "${!files[@]}"; do
|
for i in "${!files[@]}"; do
|
||||||
file=${files[$i]}
|
file=${files[$i]}
|
||||||
file_pkg=${files_pkg[$i]}
|
file_pkg=${files_pkg[$i]}
|
||||||
installed=N
|
if [ ! -f "$file" ]; then
|
||||||
[ $installed == N -a -f "$file" ] && installed=Y
|
need+=($file)
|
||||||
[ $installed == N ] && need+=($file) && need_pkg+=("$file_pkg")
|
need_pkg+=("$file_pkg")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in "${!perl_mod[@]}"; do
|
for i in "${!perl_mod[@]}"; do
|
||||||
@ -59,13 +63,15 @@ get_yes_no()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [ -f /etc/lsb-release ]; then
|
if [ -f /etc/lsb-release ]; then
|
||||||
DISTRO=$(grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2 | tr A-Z a-z)
|
DISTRO=$(grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
DISTRO=$(grep ^ID= /etc/os-release | cut -d "=" -f 2 | tr A-Z a-z)
|
DISTRO=$(grep ^ID= /etc/os-release | cut -d "=" -f 2)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DISTRO=${DISTRO,,}
|
||||||
|
|
||||||
deps=(wget bash bc gcc sed patch lsdiff tar bzip2 gzip perl gawk gperf zip unzip diff lzop)
|
deps=(wget bash bc gcc sed patch lsdiff tar bzip2 gzip perl gawk gperf zip unzip diff lzop)
|
||||||
deps_pkg=(wget bash bc gcc sed patch patchutils tar bzip2 gzip perl gawk gperf zip unzip diffutils lzop)
|
deps_pkg=(wget bash bc gcc sed patch patchutils tar bzip2 gzip perl gawk gperf zip unzip diffutils lzop)
|
||||||
|
|
||||||
@ -78,8 +84,14 @@ case "$DISTRO" in
|
|||||||
fedora|centos|rhel)
|
fedora|centos|rhel)
|
||||||
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
|
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
|
||||||
deps_pkg+=(gcc-c++ xorg-x11-font-utils xorg-x11-font-utils xorg-x11-font-utils libxslt java-1.7.0-openjdk python2)
|
deps_pkg+=(gcc-c++ xorg-x11-font-utils xorg-x11-font-utils xorg-x11-font-utils libxslt java-1.7.0-openjdk python2)
|
||||||
[[ ! $(rpm -qa glibc-static) ]] && deps+=(glibc-static) && deps_pkg+=(glibc-static)
|
if [[ ! $(rpm -qa glibc-static) ]]; then
|
||||||
[[ ! $(rpm -qa libstdc++-static) ]] && deps+=(libstdc++-static) && deps_pkg+=(libstdc++-static)
|
deps+=(glibc-static)
|
||||||
|
deps_pkg+=(glibc-static)
|
||||||
|
fi
|
||||||
|
if [[ ! $(rpm -qa libstdc++-static) ]]; then
|
||||||
|
deps+=(libstdc++-static)
|
||||||
|
deps_pkg+=(libstdc++-static)
|
||||||
|
fi
|
||||||
files_pkg=(glibc-headers ncurses-devel)
|
files_pkg=(glibc-headers ncurses-devel)
|
||||||
perl_pkg=(perl-JSON perl-XML-parser)
|
perl_pkg=(perl-JSON perl-XML-parser)
|
||||||
;;
|
;;
|
||||||
@ -97,7 +109,10 @@ case "$DISTRO" in
|
|||||||
opensuse)
|
opensuse)
|
||||||
deps+=( g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
|
deps+=( g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
|
||||||
deps_pkg+=(gcc-c++ mkfontscale mkfontdir bdftopcf libxslt-tools java-1_8_0-openjdk python)
|
deps_pkg+=(gcc-c++ mkfontscale mkfontdir bdftopcf libxslt-tools java-1_8_0-openjdk python)
|
||||||
[[ ! $(rpm -qa glibc-devel-static) ]] && deps+=(glibc-devel-static) && deps_pkg+=(glibc-devel-static)
|
if [[ ! $(rpm -qa glibc-devel-static) ]]; then
|
||||||
|
deps+=(glibc-devel-static)
|
||||||
|
deps_pkg+=(glibc-devel-static)
|
||||||
|
fi
|
||||||
perl_pkg=(perl-JSON perl-XML-Parser)
|
perl_pkg=(perl-JSON perl-XML-Parser)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user