Commit 8bfb8c6a authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

test/vm_setup.sh: exit with error when unsupported pkg manager is detected



Exit early from script execution when unsupported pkg manager is found.
Just not before the "--help" has a chance to be called.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I176bf5778dd7b2bc510f54842202113c8614a9d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3054


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 82540a6f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -73,8 +73,6 @@ elif hash pacman &> /dev/null; then
elif hash pkg &> /dev/null; then
	source "$vmsetupdir/pkgdep/pkg"
else
	echo "Supported package manager not found. Script supports:"
	printf ' * %s\n' "${managers[@]##*/}"
	package_manager="undefined"
fi

@@ -110,6 +108,12 @@ while getopts 'd:siuht:c:-:' optchar; do
	esac
done

if [[ "$package_manager" == "undefined" ]]; then
	echo "Supported package manager not found. Script supports:"
	printf ' * %s\n' "${managers[@]##*/}"
	exit 1
fi

if [ -n "$CONF_PATH" ]; then
	if [ ! -f "$CONF_PATH" ]; then
		echo Configuration file does not exist: "$CONF_PATH"