Quellcode durchsuchen

feat: give warning if distro is not supported by vendor (#3723)

Daniel Gibbs vor 4 Jahren
Ursprung
Commit
1c3e5048eb
2 geänderte Dateien mit 25 neuen und 0 gelöschten Zeilen
  1. 8 0
      lgsm/functions/check_deps.sh
  2. 17 0
      lgsm/functions/info_distro.sh

+ 8 - 0
lgsm/functions/check_deps.sh

@@ -316,6 +316,14 @@ if [ "${commandname}" == "INSTALL" ]; then
 	fi
 fi
 
+# Will warn user if their distro is no longer supported by the vendor.
+if [ -n "${distrosupport}" ]; then
+	if [ "${distrosupport}" == "unsupported" ]; then
+		fn_print_warning_nl "${distroname} is no longer supported by the vendor. Upgrading is recommended."
+		fn_script_log_warn "${distroname} is no longer supported by the vendor. Upgrading is recommended."
+	fi
+fi
+
 info_distro.sh
 
 if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then

+ 17 - 0
lgsm/functions/info_distro.sh

@@ -80,6 +80,23 @@ else
 	distroversioncsv="${distroversion}"
 fi
 
+# Check if distro supported by distro vendor.
+if [ "$(command -v distro-info 2>/dev/null)" ]; then
+	distrosunsupported="$(distro-info --unsupported)"
+	distrosunsupported_array=( "${distrosunsupported}" )
+	for distrounsupported in "${distrosunsupported_array[@]}"; do
+		if [ "${distrounsupported}" == "${distrocodename}" ]; then
+			distrosupport=unsupported
+			break
+		else
+			distrosupport=supported
+		fi
+	done
+else
+	distrosupport=unknown
+fi
+
+echo "${distrosupport}"
 ## Glibc version
 # e.g: 1.17
 glibcversion="$(ldd --version | sed -n '1s/.* //p')"