setup-env-internal: improve distro name checking

so substrings of distro names in the list don't
count as valid.

Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
Matt Madison
2022-05-15 04:11:18 -07:00
parent edca3ed020
commit 56f5fa84dd

View File

@@ -113,7 +113,7 @@ if [ ! -e $BUILDDIR/conf/local.conf ]; then
if [ -z "$DISTRO" ]; then
DISTRO=$DISTRO_DEFAULT
fi
if ! distro_list | grep -q "$DISTRO"; then
if ! distro_list | egrep -qx "[[:space:]]*$DISTRO"; then
echo "ERROR: distro \"$DISTRO\" not found" >&2
echo "Available DISTROs:" >&2
distro_list >&2