check_deps.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. #!/bin/bash
  2. # LinuxGSM check_deps.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Checks and installs missing dependencies.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. fn_install_dotnet_repo() {
  9. if [ "${distroid}" == "ubuntu" ]; then
  10. # if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo.
  11. if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then
  12. fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
  13. sudo dpkg -i /tmp/packages-microsoft-prod.deb
  14. fi
  15. elif [ "${distroid}" == "debian" ]; then
  16. fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
  17. sudo dpkg -i /tmp/packages-microsoft-prod.deb
  18. fi
  19. }
  20. fn_install_mono_repo() {
  21. if [ "${autodepinstall}" == "0" ]; then
  22. fn_print_information_nl "Automatically adding Mono repository."
  23. fn_script_log_info "Automatically adding Mono repository."
  24. echo -en ".\r"
  25. fn_sleep_time_1
  26. echo -en "..\r"
  27. fn_sleep_time_1
  28. echo -en "...\r"
  29. fn_sleep_time_1
  30. echo -en " \r"
  31. if [ "${distroid}" == "ubuntu" ]; then
  32. if [ "${distroversion}" == "22.04" ]; then
  33. cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-jammy main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  34. elif [ "${distroversion}" == "20.04" ]; then
  35. cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  36. elif [ "${distroversion}" == "18.04" ]; then
  37. cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  38. elif [ "${distroversion}" == "16.04" ]; then
  39. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https ca-certificates;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  40. else
  41. monoautoinstall="1"
  42. fi
  43. elif [ "${distroid}" == "debian" ]; then
  44. if [ "${distroversion}" == "12" ]; then
  45. cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bookworm main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  46. elif [ "${distroversion}" == "11" ]; then
  47. cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bullseye main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  48. elif [ "${distroversion}" == "10" ]; then
  49. cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  50. elif [ "${distroversion}" == "9" ]; then
  51. cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  52. else
  53. monoautoinstall="1"
  54. fi
  55. elif [ "${distroid}" == "centos" ] || [ "${distroid}" == "almalinux" ] || [ "${distroid}" == "rocky" ]; then
  56. if [ "${distroversion}" == "8" ]; then
  57. cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'"
  58. elif [ "${distroversion}" == "7" ]; then
  59. cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'"
  60. else
  61. monoautoinstall="1"
  62. fi
  63. elif [ "${distroid}" == "fedora" ]; then
  64. if [ "${distroversion}" -ge "29" ]; then
  65. cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo';dnf update"
  66. else
  67. cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo';dnf update"
  68. fi
  69. else
  70. monoautoinstall="1"
  71. fi
  72. # Run the mono repo install.
  73. eval "${cmd}"
  74. monorepoexitcode=$?
  75. # Did Mono repo install correctly?
  76. if [ "${monoautoinstall}" != "1" ]; then
  77. if [ "${monorepoexitcode}" -ne 0 ]; then
  78. fn_print_failure_nl "Unable to install Mono repository."
  79. fn_script_log_fail "Unable to install Mono repository."
  80. else
  81. fn_print_success_nl "Installing Mono repository completed."
  82. fn_script_log_pass "Installing Mono repository completed."
  83. fi
  84. fi
  85. # Mono can not be auto installed with this distro.
  86. if [ "${monoautoinstall}" == "1" ]; then
  87. fn_print_warning_nl "Mono auto install not available for ${distroname}."
  88. echo -e "Follow instructions on Mono website to install."
  89. echo -e "https://www.mono-project.com/download/stable/#download-lin"
  90. fn_script_log_warn "Unable to install Mono repository. Mono auto install not available for ${distroname}."
  91. fi
  92. else
  93. fn_print_information_nl "Installing Mono repository."
  94. fn_print_warning_nl "$(whoami) does not have sudo access."
  95. echo -e "Follow instructions on Mono website to install."
  96. echo -e "https://www.mono-project.com/download/stable/#download-lin"
  97. fn_script_log_warn "Unable to install Mono repository. $(whoami) does not have sudo access."
  98. fi
  99. }
  100. fn_deps_email() {
  101. # Adds postfix to required dependencies if email alert is enabled.
  102. if [ "${emailalert}" == "on" ]; then
  103. if [ -f /usr/bin/mailx ]; then
  104. if [ -d /etc/exim4 ]; then
  105. array_deps_required+=(exim4)
  106. elif [ -d /etc/sendmail ]; then
  107. array_deps_required+=(sendmail)
  108. elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
  109. array_deps_required+=(s-nail postfix)
  110. elif [ "$(command -v apt 2> /dev/null)" ]; then
  111. array_deps_required+=(mailutils postfix)
  112. fi
  113. else
  114. if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
  115. array_deps_required+=(s-nail postfix)
  116. elif [ "$(command -v apt 2> /dev/null)" ]; then
  117. array_deps_required+=(mailutils postfix)
  118. fi
  119. fi
  120. fi
  121. }
  122. fn_install_missing_deps() {
  123. # If any dependencies are not installed.
  124. if [ "${#array_deps_missing[*]}" != "0" ]; then
  125. if [ "${commandname}" == "INSTALL" ]; then
  126. fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[*]}${default}"
  127. fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}"
  128. else
  129. fn_print_dots "Missing dependencies"
  130. fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}"
  131. fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}"
  132. fi
  133. # Attempt automatic dependency installation
  134. if [ "${autoinstall}" == "1" ]; then
  135. sudo -n true > /dev/null 2>&1
  136. else
  137. sudo -v > /dev/null 2>&1
  138. fi
  139. autodepinstall="$?"
  140. if [ "${monoinstalled}" == "false" ]; then
  141. fn_install_mono_repo
  142. fi
  143. if [ "${dotnetinstalled}" == "false" ]; then
  144. fn_install_dotnet_repo
  145. fi
  146. if [ "${commandname}" == "INSTALL" ]; then
  147. if [ "${autodepinstall}" == "0" ]; then
  148. fn_print_information_nl "$(whoami) has sudo access."
  149. fn_script_log_info "$(whoami) has sudo access."
  150. else
  151. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root."
  152. fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root."
  153. fi
  154. fi
  155. # Add sudo dpkg --add-architecture i386 if using i386 packages.
  156. if [ "$(command -v apt 2> /dev/null)" ]; then
  157. if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then
  158. i386installcommand="sudo dpkg --add-architecture i386; "
  159. fi
  160. fi
  161. # If automatic dependency install is available
  162. if [ "${autodepinstall}" == "0" ]; then
  163. fn_print_information_nl "Automatically installing missing dependencies."
  164. fn_script_log_info "Automatically installing missing dependencies."
  165. echo -en ".\r"
  166. fn_sleep_time_1
  167. echo -en "..\r"
  168. fn_sleep_time_1
  169. echo -en "...\r"
  170. fn_sleep_time_1
  171. echo -en " \r"
  172. if [ "$(command -v apt 2> /dev/null)" ]; then
  173. cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; ${i386installcommand}sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}"
  174. eval "${cmd}"
  175. elif [ "$(command -v dnf 2> /dev/null)" ]; then
  176. cmd="sudo dnf -y install ${array_deps_missing[*]}"
  177. eval "${cmd}"
  178. elif [ "$(command -v yum 2> /dev/null)" ]; then
  179. cmd="sudo yum -y install ${array_deps_missing[*]}"
  180. eval "${cmd}"
  181. fi
  182. autodepinstall="$?"
  183. # If auto install passes, remove steamcmd install failure and set exit code to 0.
  184. if [ "${autodepinstall}" == "0" ]; then
  185. unset steamcmdfail
  186. exitcode=0
  187. fi
  188. fi
  189. # If automatic dependency install is unavailable.
  190. if [ "${autodepinstall}" != "0" ]; then
  191. if [ "$(command -v apt 2> /dev/null)" ]; then
  192. echo -e " Run: '${green}${i386installcommand}sudo apt update; sudo apt install ${array_deps_missing[*]}${default}' as root to install missing dependencies."
  193. elif [ "$(command -v dnf 2> /dev/null)" ]; then
  194. echo -e " Run: '${green}sudo dnf install ${array_deps_missing[*]}${default}' as root to install missing dependencies."
  195. elif [ "$(command -v yum 2> /dev/null)" ]; then
  196. echo -e " Run: '${green}sudo yum install ${array_deps_missing[*]}${default}' as root to install missing dependencies."
  197. fi
  198. fi
  199. if [ "${steamcmdfail}" ]; then
  200. if [ "${commandname}" == "INSTALL" ]; then
  201. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  202. fn_script_log_fail "Missing dependencies required to run SteamCMD."
  203. core_exit.sh
  204. else
  205. fn_print_error_nl "Missing dependencies required to run SteamCMD."
  206. fn_script_log_error "Missing dependencies required to run SteamCMD."
  207. fi
  208. fi
  209. else
  210. if [ "${commandname}" == "INSTALL" ]; then
  211. fn_print_skip2_nl "Required dependencies already installed."
  212. fn_script_log_info "Required dependencies already installed."
  213. fi
  214. fi
  215. }
  216. fn_check_loop() {
  217. # Loop though required dependencies checking if they are installed.
  218. for deptocheck in "${array_deps_required[@]}"; do
  219. fn_deps_detector
  220. done
  221. # user will be informed of any missing dependencies.
  222. fn_install_missing_deps
  223. }
  224. # Checks if dependency is installed or not.
  225. fn_deps_detector() {
  226. ## Check.
  227. # SteamCMD: Will be removed from required array if no appid is present or non-free repo is not available.
  228. # This will cause SteamCMD to be installed using tar.
  229. if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then
  230. array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}")
  231. steamcmdstatus=1
  232. return
  233. elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then
  234. array_deps_required=("${array_deps_required[@]/steamcmd/}")
  235. steamcmdstatus=1
  236. return
  237. elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE '[^deb]+non-free([^-]|$)' /etc/apt/sources.list; then
  238. array_deps_required=("${array_deps_required[@]/steamcmd/}")
  239. steamcmdstatus=1
  240. return
  241. # Java: Added for users using Oracle JRE to bypass check.
  242. elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then
  243. # Is java already installed?
  244. if [ -n "${javaversion}" ]; then
  245. # Added for users using Oracle JRE to bypass check.
  246. depstatus=0
  247. deptocheck="${javaversion}"
  248. else
  249. depstatus=1
  250. fi
  251. # Mono: A Mono repo needs to be installed.
  252. elif [ "${deptocheck}" == "mono-complete" ]; then
  253. if [ -n "${monoversion}" ] && [ "${monoversion}" -ge "5" ]; then
  254. # Mono >= 5.0.0 already installed.
  255. depstatus=0
  256. monoinstalled=true
  257. else
  258. # Mono not installed or installed Mono < 5.0.0.
  259. depstatus=1
  260. monoinstalled=false
  261. fi
  262. # .NET Core: A .NET Core repo needs to be installed.
  263. elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then
  264. # .NET is not installed.
  265. if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then
  266. depstatus=0
  267. dotnetinstalled=true
  268. else
  269. depstatus=1
  270. dotnetinstalled=false
  271. fi
  272. elif [ "$(command -v apt 2> /dev/null)" ]; then
  273. dpkg-query -W -f='${Status}' "${deptocheck}" 2> /dev/null | grep -q -P '^install ok installed'
  274. depstatus=$?
  275. elif [ "$(command -v dnf 2> /dev/null)" ]; then
  276. dnf list installed "${deptocheck}" > /dev/null 2>&1
  277. depstatus=$?
  278. elif [ "$(command -v rpm 2> /dev/null)" ]; then
  279. rpm -q "${deptocheck}" > /dev/null 2>&1
  280. depstatus=$?
  281. fi
  282. # Outcome of Check.
  283. if [ "${steamcmdstatus}" == "1" ]; then
  284. # If SteamCMD is not available in repo dont check for it.
  285. unset steamcmdstatus
  286. elif [ "${depstatus}" == "0" ]; then
  287. # If dependency is found.
  288. missingdep=0
  289. if [ "${commandname}" == "INSTALL" ]; then
  290. echo -e "${green}${deptocheck}${default}"
  291. fn_sleep_time
  292. fi
  293. elif [ "${depstatus}" != "0" ]; then
  294. # If dependency is not found.
  295. missingdep=1
  296. if [ "${commandname}" == "INSTALL" ]; then
  297. echo -e "${red}${deptocheck}${default}"
  298. fn_sleep_time
  299. fi
  300. # If SteamCMD requirements are not met install will fail.
  301. if [ -n "${appid}" ]; then
  302. for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do
  303. if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
  304. steamcmdfail=1
  305. fi
  306. done
  307. fi
  308. fi
  309. unset depstatus
  310. # Missing dependencies are added to array_deps_missing.
  311. if [ "${missingdep}" == "1" ]; then
  312. array_deps_missing+=("${deptocheck}")
  313. fi
  314. }
  315. if [ "${commandname}" == "INSTALL" ]; then
  316. if [ "$(whoami)" == "root" ]; then
  317. echo -e ""
  318. echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}"
  319. fn_messages_separator
  320. fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
  321. fn_print_information_nl "This will NOT install a ${gamename} server."
  322. else
  323. echo -e ""
  324. echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}"
  325. fn_messages_separator
  326. fi
  327. fi
  328. info_distro.sh
  329. # Will warn user if their distro is no longer supported by the vendor.
  330. if [ -n "${distrosupport}" ]; then
  331. if [ "${distrosupport}" == "unsupported" ]; then
  332. fn_print_warning_nl "${distroname} is no longer supported by the vendor or LinuxGSM. Upgrading is recommended."
  333. fn_script_log_warn "${distroname} is no longer supported by the vendor or LinuxGSM. Upgrading is recommended."
  334. fi
  335. fi
  336. # These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm).
  337. if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then
  338. if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then
  339. fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)."
  340. fn_script_log_fail "${gamename} is not supported on ${distroname}."
  341. core_exit.sh
  342. fi
  343. fi
  344. # These titles are only supported up to Ubuntu 20.04 and Debian 11 (and Debian-like derivatives).
  345. if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then
  346. if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then
  347. fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 20.04 or Debian <= 11)."
  348. fn_script_log_fail "${gamename} is not supported on ${distroname}."
  349. core_exit.sh
  350. fi
  351. fi
  352. if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
  353. # Check that the distro dependency csv file exists.
  354. fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"
  355. if [ -n "${checkflag}" ] && [ "${checkflag}" == "0" ]; then
  356. fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "${datadir}" "chmodx" "norun" "noforce" "nohash"
  357. fi
  358. fi
  359. # If the file successfully downloaded run the dependency check.
  360. if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
  361. depall=$(awk -F, '$1=="all" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv")
  362. depsteamcmd=$(awk -F, '$1=="steamcmd" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv")
  363. depshortname=$(awk -v shortname="${shortname}" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv")
  364. # Generate array of missing deps.
  365. array_deps_missing=()
  366. array_deps_required=("${depall} ${depsteamcmd} ${depshortname}")
  367. array_deps_required_steamcmd=("${depsteamcmd}")
  368. fn_deps_email
  369. # Unique sort dependency array.
  370. IFS=" " read -r -a array_deps_required <<< "$(echo "${array_deps_required[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
  371. fn_check_loop
  372. # Warn the user that dependency checking is unavailable for their distro.
  373. elif [ "${commandname}" == "INSTALL" ] || [ -n "${checkflag}" ] && [ "${checkflag}" != "0" ]; then
  374. fn_print_warning_nl "LinuxGSM dependency checking currently unavailable for ${distroname}."
  375. # Prevent future dependency checking if unavailable for the distro.
  376. echo "${version}" > "${tmpdir}/dependency-no-check.tmp"
  377. elif [ -f "${tmpdir}/dependency-no-check.tmp" ]; then
  378. # Allow LinuxGSM to try a dependency check if LinuxGSM has been recently updated.
  379. nocheckversion=$(cat "${tmpdir}/dependency-no-check.tmp")
  380. if [ "${version}" != "${nocheckversion}" ]; then
  381. rm -f "${tmpdir:?}/dependency-no-check.tmp"
  382. fi
  383. fi