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 <michalx.berger@intel.com>
Change-Id: If6a71ea08b315f54c906206165e3dbcd4c21379c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10260
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Michal Berger 2021-11-17 13:32:31 +01:00 committed by Tomasz Zawadzki
parent 366f8914b6
commit 0b6a29d4a2

View File

@ -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