From 701195c7ffbae45c336b2970db79961353b9f150 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 17 Nov 2021 13:32:31 +0100 Subject: [PATCH] pkgdep: Fix ID lookup In case of linux systems, which don't provide /etc/os-release, the ID would become plain "linux" (due to a fallback to uname). This would result in a confusing message stating that we don't support a "linux" platform. Instead, be specific as to what we are looking for and what distros we support. Signed-off-by: Michal Berger Change-Id: If6a71ea08b315f54c906206165e3dbcd4c21379c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10260 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Monica Kenguva Reviewed-by: Tomasz Zawadzki --- scripts/pkgdep.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/pkgdep.sh b/scripts/pkgdep.sh index 9e13d98b0..f2fc41c9e 100755 --- a/scripts/pkgdep.sh +++ b/scripts/pkgdep.sh @@ -80,12 +80,16 @@ OS=$(uname -s) if [[ -e /etc/os-release ]]; then source /etc/os-release +elif [[ $OS == FreeBSD ]]; then + ID=freebsd +else + ID=unknown fi -ID=${ID:-$OS} ID=${ID,,} +ID=${ID,,} #Link suse related OS to sles -if [[ ${ID,,} == *"suse"* ]]; then +if [[ $ID == *"suse"* ]]; then ID="sles" fi @@ -97,5 +101,5 @@ for id in $ID $ID_LIKE; do fi done -printf 'Not supported platform detected (%s), aborting\n' "$ID" >&2 +printf 'Not supported distribution detected (%s), aborting\n' "$ID" >&2 exit 1