From 024b2f3e785cab0e76d8f9c72812d8322bd2854a Mon Sep 17 00:00:00 2001 From: jcrew99 <37361441+jcrew99@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:02:48 +1000 Subject: [PATCH] Revert "Revert "Add support for the SuSE family in the installer (#2590)" (#2594)" (#2603) This reverts commit dc9e41c55a467e34d2f494aacfbc95b230a6df56. --- install | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/install b/install index 05c6525a3..7dc4c48b6 100755 --- a/install +++ b/install @@ -6,7 +6,9 @@ # set -euo pipefail -IFS=$'\n\t' +NORMIFS=$IFS +SCRIFS=$'\n\t' +IFS=$SCRIFS info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; } warn() { echo -e "\\033[1;33m[WARNING]\\033[0m $*"; } @@ -89,7 +91,9 @@ install_linux() { Distro='Kali' elif [ "${DISTRO_ID}" = 'arch' ] || [ "${DISTRO_ID}" = 'artix' ] || [ "${DISTRO_ID}" = 'manjaro' ] || [ "${DISTRO_ID}" = 'blackarch' ] || [ "${DISTRO_ID}" = 'arcolinux' ]; then Distro='Arch' - fi + elif cat /etc/os-release | grep -Eqi '^ID.*suse'; then + Distro='SuSE' + fi # Usually, I would do this very differently (. /etc/os-release ...), but keeping to the style. fi if [ -z "${Distro}" ]; then @@ -109,6 +113,16 @@ install_linux() { fi elif [ "${Distro}" = "RedHat" ]; then sudo yum install -y git make gcc openssl-devel gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel bzip2 autoconf automake libtool bison sqlite-devel nodejs + elif [ "${Distro}" = "SuSE" ]; then + IFS=$NORMIFS + intpkg="" + nodejsver=nodejs16 + rpm --quiet -q nodejs18 && nodejsver="" # having NodeJS 18 installed should mean NodeJS 16 is not needed + for i in git make gcc libopenssl-devel gcc-c++ patch libreadline6 readline6-devel libz1 zlib-devel libyaml-devel libffi-devel bzip2 autoconf automake libtool bison sqlite3-devel $nodejsver; do + rpm --quiet -q $i || intpkg="$intpkg $i" + done + [ "$intpkg" ] && sudo zypper -n install -l $intpkg + IFS=$SCRIFS elif [ "${Distro}" = "blackPanther" ]; then installing --auto git make gcc openssl-devel gcc-c++ patch readline-devel zlib-devel yaml-devel libffi-devel bzip2 autoconf automake libtool bison sqlite-devel nodejs sudo elif [ "${Distro}" = "Arch" ]; then