Skip to content

build-script: use more terse checks #29340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 13 additions & 28 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -854,34 +854,19 @@ if [[ "${SKIP_RECONFIGURE}" ]]; then
RECONFIGURE=""
fi

# WORKSPACE, BUILD_DIR and INSTALLABLE_PACKAGE must be absolute paths
case "${WORKSPACE}" in
/*) ;;
*)
echo "workspace must be an absolute path (was '${WORKSPACE}')"
exit 1
;;
esac
case "${BUILD_DIR}" in
/*) ;;
"")
echo "the --build-dir option is required"
usage
exit 1
;;
*)
echo "build-dir must be an absolute path (was '${BUILD_DIR}')"
exit 1
;;
esac
case "${INSTALLABLE_PACKAGE}" in
/*) ;;
"") ;;
*)
echo "installable-package must be an absolute path (was '${INSTALLABLE_PACKAGE}')"
exit 1
;;
esac
# WORKSPACE, BUILD_DIR, and INSTALLABLE_PACKAGE must be absolute paths
if ! [[ ${WORKSPACE} =~ ^/ ]] ; then
echo "workspace must be an absolute path (was '${WORKSPACE}')"
exit 1
fi
if ! [[ ${BUILD_DIR} =~ ^/ ]] ; then
echo "build-dir must be an absolute path (was '${BUILD_DIR}')"
exit 1
fi
if ! [[ ${INSTALLABLE_PACKAGE:-/} =~ ^/ ]] ; then
echo "installable-package must be an absolute path (was '${INSTALLABLE_PACKAGE}')"
exit 1
fi

# WORKSPACE must exist
if [ ! -e "${WORKSPACE}" ] ; then
Expand Down