diff --git a/scripts/checkdeps b/scripts/checkdeps index 6a1d06f09d..1aaaf96285 100755 --- a/scripts/checkdeps +++ b/scripts/checkdeps @@ -27,15 +27,19 @@ get_deps() { for i in "${!deps[@]}"; do dep=${deps[$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 for i in "${!files[@]}"; do file=${files[$i]} file_pkg=${files_pkg[$i]} - installed=N - [ $installed == N -a -f "$file" ] && installed=Y - [ $installed == N ] && need+=($file) && need_pkg+=("$file_pkg") + if [ ! -f "$file" ]; then + need+=($file) + need_pkg+=("$file_pkg") + fi done for i in "${!perl_mod[@]}"; do @@ -78,8 +82,14 @@ case "$DISTRO" in fedora|centos|rhel) 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) - [[ ! $(rpm -qa glibc-static) ]] && deps+=(glibc-static) && deps_pkg+=(glibc-static) - [[ ! $(rpm -qa libstdc++-static) ]] && deps+=(libstdc++-static) && deps_pkg+=(libstdc++-static) + if [[ ! $(rpm -qa glibc-static) ]]; then + 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) perl_pkg=(perl-JSON perl-XML-parser) ;; @@ -97,7 +107,10 @@ case "$DISTRO" in opensuse) deps+=( g++ mkfontscale mkfontdir bdftopcf xsltproc java 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) ;; *)