From cf0286d2751915b59427ce0db780c2df77da443a Mon Sep 17 00:00:00 2001 From: Caleb John Date: Wed, 18 Aug 2021 04:01:58 -0700 Subject: [PATCH] Linux: Fixes #5240: Remove dependency on lsb_release from install script (#5323) Some platforms (notably OpenSuse) do not come with the lsb_release binary, and don't need it to successfully install Joplin. --- Joplin_install_and_update.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Joplin_install_and_update.sh b/Joplin_install_and_update.sh index 00acdb34b..bdea8ee21 100755 --- a/Joplin_install_and_update.sh +++ b/Joplin_install_and_update.sh @@ -171,19 +171,23 @@ else fi DESKTOP=${DESKTOP,,} # convert to lower case -# Detect distribution environment -DISTVER=$(lsb_release -is) && DISTVER=$DISTVER$(lsb_release -rs) -DISTCODENAME=$(lsb_release -cs) -#----------------------------------------------------- echo 'Create Desktop icon...' -# Check for "The SUID sandbox helper binary was found, but is not configured correctly" problem. -# It is present in Debian 10 Buster. A (temporary) patch will be applied at .desktop file -# Linux Mint 4 Debbie is based on Debian 10 and requires the same param handling. -if [ "$DISTVER" = "Debian10" ] || [ "$DISTVER" = "Linuxmint4" ] && [ "$DISTCODENAME" = "debbie" ] -then - SANDBOXPARAM=" --no-sandbox" -else - SANDBOXPARAM="" + +# Detect distribution environment, and apply --no-sandbox fix +SANDBOXPARAM="" +# lsb_release isn't available on some platforms (e.g. opensuse) +# The equivalent of lsb_release in OpenSuse is the file /usr/lib/os-release +if command -v lsb_release &> /dev/null; then + DISTVER=$(lsb_release -is) && DISTVER=$DISTVER$(lsb_release -rs) + DISTCODENAME=$(lsb_release -cs) + #----------------------------------------------------- + # Check for "The SUID sandbox helper binary was found, but is not configured correctly" problem. + # It is present in Debian 1X. A (temporary) patch will be applied at .desktop file + # Linux Mint 4 Debbie is based on Debian 10 and requires the same param handling. + if [ $DISTVER =~ Debian1. ] || [ "$DISTVER" = "Linuxmint4" ] && [ "$DISTCODENAME" = "debbie" ] + then + SANDBOXPARAM=" --no-sandbox" + fi fi # Initially only desktop environments that were confirmed to use desktop files stored in