Skip to content

Commit 1c3e504

Browse files
authored
feat: give warning if distro is not supported by vendor (#3723)
1 parent a82ac53 commit 1c3e504

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lgsm/functions/check_deps.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ if [ "${commandname}" == "INSTALL" ]; then
316316
fi
317317
fi
318318

319+
# Will warn user if their distro is no longer supported by the vendor.
320+
if [ -n "${distrosupport}" ]; then
321+
if [ "${distrosupport}" == "unsupported" ]; then
322+
fn_print_warning_nl "${distroname} is no longer supported by the vendor. Upgrading is recommended."
323+
fn_script_log_warn "${distroname} is no longer supported by the vendor. Upgrading is recommended."
324+
fi
325+
fi
326+
319327
info_distro.sh
320328

321329
if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then

lgsm/functions/info_distro.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ else
8080
distroversioncsv="${distroversion}"
8181
fi
8282

83+
# Check if distro supported by distro vendor.
84+
if [ "$(command -v distro-info 2>/dev/null)" ]; then
85+
distrosunsupported="$(distro-info --unsupported)"
86+
distrosunsupported_array=( "${distrosunsupported}" )
87+
for distrounsupported in "${distrosunsupported_array[@]}"; do
88+
if [ "${distrounsupported}" == "${distrocodename}" ]; then
89+
distrosupport=unsupported
90+
break
91+
else
92+
distrosupport=supported
93+
fi
94+
done
95+
else
96+
distrosupport=unknown
97+
fi
98+
99+
echo "${distrosupport}"
83100
## Glibc version
84101
# e.g: 1.17
85102
glibcversion="$(ldd --version | sed -n '1s/.* //p')"

0 commit comments

Comments
 (0)