Commit 0b6a29d4 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMonica Kenguva <monica.kenguva@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 366f8914
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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