Skip to content

Commit

Permalink
fix(install): resolve steamcmd dependency issues (#3583)
Browse files Browse the repository at this point in the history
* fix(install): improve steamcmd detection
  • Loading branch information
dgibbs64 authored Sep 28, 2021
1 parent ac8cef7 commit 490cd3f
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 42 deletions.
4 changes: 3 additions & 1 deletion lgsm/data/almalinux-8.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down Expand Up @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven
terraria
tf2,libcurl.i686
Expand Down
4 changes: 3 additions & 1 deletion lgsm/data/centos-7.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down Expand Up @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven
terraria
tf2,libcurl.i686
Expand Down
3 changes: 2 additions & 1 deletion lgsm/data/centos-8.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/debian-10.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-11-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-11-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/debian-11.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc-s1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-16-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-16-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/debian-9.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-8-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-8-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
4 changes: 3 additions & 1 deletion lgsm/data/rhel-7.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down Expand Up @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven
terraria
tf2,libcurl.i686
Expand Down
4 changes: 3 additions & 1 deletion lgsm/data/rhel-8.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down Expand Up @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven
terraria
tf2,libcurl.i686
Expand Down
4 changes: 3 additions & 1 deletion lgsm/data/rocky-8.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,epel-release,curl,wget,util-linux,python36,file,tar,gzip,bzip2,unzip,xz,binutils,bc,jq,tmux,nmap-ncat,cpio,hostname
all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz
steamcmd,glibc.i686,libstdc++.i686
ac
ahl
ahl2
Expand Down Expand Up @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven
terraria
tf2,libcurl.i686
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/ubuntu-16.04.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-8-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-8-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/ubuntu-18.04.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-11-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-11-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
9 changes: 5 additions & 4 deletions lgsm/data/ubuntu-20.04.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc1,lib32stdc++6,hostname
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -69,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-16-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-16-jre,rng-tools
q2
q3
ql
Expand All @@ -97,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
8 changes: 5 additions & 3 deletions lgsm/data/ubuntu-21.04.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,jq,python3,tar,tmux,util-linux,netcat,unzip,xz-utils,lib32gcc-s1,lib32stdc++6,hostname
all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils
steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd
ac
ahl
ahl2
Expand Down Expand Up @@ -68,14 +69,14 @@ nmrih,libtinfo5:i386
ns
ns2,speex,libtbb2
ns2c,speex:i386,libtbb2
onset
onset,libmariadbclient-dev
opfor
pc
pmc,openjdk-16-jre
pstbs,libgconf-2-4
pvkii
pvr,libc++1
pz
pz,openjdk-16-jre,rng-tools
q2
q3
ql
Expand All @@ -96,6 +97,7 @@ sof2
sol
squad
st
stn
sven,libssl1.1:i386,zlib1g:i386
terraria
tf2,libcurl4-gnutls-dev:i386
Expand Down
36 changes: 22 additions & 14 deletions lgsm/functions/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ fn_install_missing_deps(){
eval "${cmd}"
fi
autodepinstall="$?"

# If auto install passes remove steamcmd install failure.
if [ "${autodepinstall}" == "0" ]; then
unset steamcmdfail
fi
fi

# If automatic dependency install is unavailable.
Expand Down Expand Up @@ -217,8 +222,14 @@ fn_check_loop(){

# Checks if dependency is installed or not.
fn_deps_detector(){
## Check.
# SteamCMD: Will be removed from required array if non-free repo is not available.
# This will cause SteamCMD to be installed using tar.
if [ "${deptocheck}" == "steamcmd" ]&&[ "${distroid}" == "debian" ]&& ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then
array_deps_required=( "${array_deps_required[@]/steamcmd}" )
steamcmdstatus=1
# Java: Added for users using Oracle JRE to bypass check.
if [[ ${deptocheck} == "openjdk"* ]]||[[ ${deptocheck} == "java"* ]]; then
elif [[ ${deptocheck} == "openjdk"* ]]||[[ ${deptocheck} == "java"* ]]; then
# Is java already installed?
if [ -n "${javaversion}" ]; then
# Added for users using Oracle JRE to bypass check.
Expand Down Expand Up @@ -249,25 +260,28 @@ fn_deps_detector(){
depstatus=$?
fi

if [ "${depstatus}" == "0" ]; then
# Outcome of Check.
if [ "${steamcmdstatus}" == "1" ]; then
# If SteamCMD is not available in repo dont check for it.
unset steamcmdstatus
elif [ "${depstatus}" == "0" ]; then
# If dependency is found.
missingdep=0
if [ "${commandname}" == "INSTALL" ]; then
echo -e "${green}${deptocheck}${default}"
sleep 0.1
fi
else
elif [ "${depstatus}" != "0" ]; then
# If dependency is not found.
missingdep=1
if [ "${commandname}" == "INSTALL" ]; then
echo -e "${red}${deptocheck}${default}"
sleep 0.1
fi
# Define required dependencies for SteamCMD.
# If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then
array_steamcmd_deps_required=("${depsteamcmd}")
for steamcmddeptocheck in ${array_steamcmd_deps_required[*]}; do
if [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do
if [ "${deptocheck}" != "steamcmd" ]&&[ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
steamcmdfail=1
fi
done
Expand Down Expand Up @@ -298,13 +312,6 @@ fi

info_distro.sh

# some RHEL based distros use 8.4 instead of just 8.
if [[ "${distroidlike}" == *"rhel"* ]]||[ "${distroid}" == "rhel" ]; then
distroversioncsv="${distroversionrh}"
else
distroversioncsv="${distroversion}"
fi

if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
# Check that the disto dependency csv file exists.
fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"
Expand All @@ -323,6 +330,7 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
array_deps_missing=()

array_deps_required=("${depall} ${depsteamcmd} ${depshortname}")
array_deps_required_steamcmd=("${depsteamcmd}")
fn_deps_email
# Unique sort dependency array.
IFS=" " read -r -a array_deps_required <<< "$(echo "${array_deps_required[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
Expand Down
Loading

0 comments on commit 490cd3f

Please sign in to comment.