From e5d139e6f777bac7b62560b2e2586228a7ce1cb4 Mon Sep 17 00:00:00 2001 From: Gunnar Andersson Date: Thu, 6 Jun 2019 14:18:20 +0200 Subject: [PATCH] prerequisites.sh: Don't fail if lsb_release executable missing The first part of the script only warned if the /usr/bin/lsb_release executable is missing, but the script later failed. If lsb_release is run successfully, then the release version has been already stored in $release, so we can reuse that value to avoid running lsb_release again (and if lsb_release is missing, this fix allows the script to succeed anyway). The change also changes to numerical comparison, to implement the identified need to handle later versions beyond Ubuntu 18.04. Signed-off-by: Gunnar Andersson --- scripts/prerequisites.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/prerequisites.sh b/scripts/prerequisites.sh index e1257709..ac9a7e1b 100755 --- a/scripts/prerequisites.sh +++ b/scripts/prerequisites.sh @@ -133,9 +133,10 @@ essential="\ wget \ " -# add python3-distutils only for 18.04 (and later should be added for newer) +# add python3-distutils only for 18.04 and later # because it doesn't exist as separate package in older Ubuntu releases -[ `/usr/bin/lsb_release -s -r` = "18.04" ] && essential="${essential} python3-distutils" +release_numerical=$(echo "$release | tr -d .) +[ -n "$release" ] && [ "$release_numerical" -ge "1804" ] && essential="${essential} python3-distutils" # bzip2, gzip, tar, zip are used by our scripts/build.sh archivers="\