Skip to content

Commit e6fc8f7

Browse files
author
Gunnar Andersson
committed
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 <gandersson@genivi.org>
1 parent a68c4c7 commit e6fc8f7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/prerequisites.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ essential="\
133133
wget \
134134
"
135135

136-
# add python3-distutils only for 18.04 (and later should be added for newer)
136+
# add python3-distutils only for 18.04 and later
137137
# because it doesn't exist as separate package in older Ubuntu releases
138-
[ `/usr/bin/lsb_release -s -r` = "18.04" ] && essential="${essential} python3-distutils"
138+
release_numerical=$(echo "$release" | tr -d .)
139+
[ -n "$release" ] && [ "$release_numerical" -ge "1804" ] && essential="${essential} python3-distutils"
139140

140141
# bzip2, gzip, tar, zip are used by our scripts/build.sh
141142
archivers="\

0 commit comments

Comments
 (0)