Skip to content

Commit

Permalink
prerequisites.sh: Don't fail if lsb_release executable missing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Gunnar Andersson committed Jun 6, 2019
1 parent a68c4c7 commit e5d139e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="\
Expand Down

0 comments on commit e5d139e

Please sign in to comment.