Skip to content

Commit ec1c828

Browse files
committed
feat issue #134: support linux mint by checking /etc/os-release for ID_LIKE and UBUNTU_CODENAME
Signed-off-by: Peter Tandler <[email protected]>
1 parent 2639a23 commit ec1c828

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

install.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ get_distribution() {
112112
lsb_dist=""
113113
# Every system that we officially support has /etc/os-release
114114
if [ -r /etc/os-release ]; then
115-
lsb_dist="$(. /etc/os-release && echo "$ID")"
115+
# lsb_dist="$(. /etc/os-release && echo "$ID")"
116+
# linux mint provides the information that it is "like" ubuntu
117+
# if this is present, use $ID_LIKE
118+
lsb_dist="$(. /etc/os-release &&
119+
if [ -n "$ID_LIKE" ];
120+
then echo "$ID_LIKE"
121+
else echo "$ID"
122+
fi
123+
)"
116124
fi
117125
# Returning an empty string here should be alright since the
118126
# case statements don't act unless you provide an actual value
@@ -305,7 +313,12 @@ do_install() {
305313
case "$lsb_dist" in
306314

307315
ubuntu)
308-
if command_exists lsb_release; then
316+
# check also for ubuntu-like distros, such as linux mint
317+
# if they do pass the `UBUNTU_CODENAME`
318+
if [ -r /etc/os-release ]; then
319+
dist_version=$(. /etc/os-release && echo "$UBUNTU_CODENAME")
320+
fi
321+
if [ -z "$dist_version" ] && command_exists lsb_release; then
309322
dist_version="$(lsb_release --codename | cut -f2)"
310323
fi
311324
if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then
@@ -348,6 +361,8 @@ do_install() {
348361
# Check if this is a forked Linux distro
349362
check_forked
350363

364+
echo "Detected distribution to use for installation: $lsb_dist and version $dist_version"
365+
351366
# Run setup for each distro accordingly
352367
case "$lsb_dist" in
353368
ubuntu|debian|raspbian)

0 commit comments

Comments
 (0)