From c9b4654bd41a7ea95c08df35b43839aa9cb51df4 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Wed, 30 Nov 2022 14:22:37 +0100 Subject: [PATCH] configure: use check_dir for FC and uring check_dir verifies if the directory exists, if not then exits the script printing an error. Replaced two instances where same steps were done explicitly. Signed-off-by: Tomasz Zawadzki Change-Id: I1179bdea0630ecb1cf2f5d4cde076308145006fb Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15712 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber --- configure | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/configure b/configure index e3be52a96..864f738c2 100755 --- a/configure +++ b/configure @@ -858,10 +858,7 @@ fi if [[ "${CONFIG[FC]}" = "y" ]]; then if [[ -n "${CONFIG[FC_PATH]}" ]]; then - if [ ! -d "${CONFIG[FC_PATH]}" ]; then - echo "${CONFIG[FC_PATH]}: directory not found" - exit 1 - fi + check_dir "${CONFIG[FC_PATH]}" fi fi @@ -1077,10 +1074,7 @@ fi if [[ "${CONFIG[URING]}" = "y" ]]; then if [[ -n "${CONFIG[URING_PATH]}" ]]; then - if [ ! -d "${CONFIG[URING_PATH]}" ]; then - echo "${CONFIG[URING_PATH]}: directory not found" - exit 1 - fi + check_dir "${CONFIG[URING_PATH]}" elif ! echo -e '#include \nint main(void) { return 0; }\n' \ | "${BUILD_CMD[@]}" -luring - 2> /dev/null; then echo "--with-uring requires liburing."