Skip to content

Commit 53c7bb0

Browse files
committed
build-script: reduce duplication of check
This hoists the shared check to the beginning of the product installation phase. This can be done as a shared phase option. In theory it should be possible to hoist this further to a single check at the beginning of the phase.
1 parent 6dec36e commit 53c7bb0

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

utils/build-script-impl

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,6 +2679,10 @@ for host in "${ALL_HOSTS[@]}"; do
26792679
if ! [[ $(should_execute_action "${host}-${tmp_product}-install") ]]; then
26802680
continue
26812681
fi
2682+
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2683+
echo "--install-destdir is required to install products."
2684+
exit 1
2685+
fi
26822686

26832687
INSTALL_TARGETS="install"
26842688

@@ -2721,20 +2725,12 @@ for host in "${ALL_HOSTS[@]}"; do
27212725
if [[ -z "${INSTALL_LLDB}" ]] ; then
27222726
continue
27232727
fi
2724-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2725-
echo "--install-destdir is required to install products."
2726-
exit 1
2727-
fi
27282728
INSTALL_TARGETS="install-distribution"
27292729
;;
27302730
xctest)
27312731
if [[ -z "${INSTALL_XCTEST}" ]] ; then
27322732
continue
27332733
fi
2734-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2735-
echo "--install-destdir is required to install products."
2736-
exit 1
2737-
fi
27382734

27392735
case ${host} in
27402736
linux-*|freebsd-*|cygwin-*|haiku-*|android-*) ;;
@@ -2756,11 +2752,6 @@ for host in "${ALL_HOSTS[@]}"; do
27562752
continue
27572753
fi
27582754

2759-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2760-
echo "--install-destdir is required to install products."
2761-
exit 1
2762-
fi
2763-
27642755
;;
27652756
libdispatch|libdispatch_static)
27662757
if [[ -z "${INSTALL_LIBDISPATCH}" ]] ; then
@@ -2794,10 +2785,6 @@ for host in "${ALL_HOSTS[@]}"; do
27942785
if [[ -z "${INSTALL_LIBICU}" ]]; then
27952786
continue
27962787
fi
2797-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2798-
echo "--install-destdir is required to install products."
2799-
exit 1
2800-
fi
28012788
echo "--- Installing ${product} ---"
28022789
ICU_BUILD_DIR=$(build_directory ${host} ${product})
28032790
ICU_INSTALL_DIR="$(get_host_install_destdir ${host})$(get_host_install_prefix ${host})"
@@ -2835,10 +2822,6 @@ for host in "${ALL_HOSTS[@]}"; do
28352822
if [[ -z "${INSTALL_PLAYGROUNDSUPPORT}" ]] ; then
28362823
continue
28372824
fi
2838-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2839-
echo "--install-destdir is required to install products."
2840-
exit 1
2841-
fi
28422825

28432826
echo "--- Installing ${product} ---"
28442827

@@ -2874,11 +2857,6 @@ for host in "${ALL_HOSTS[@]}"; do
28742857
;;
28752858
esac
28762859

2877-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
2878-
echo "--install-destdir is required to install products."
2879-
exit 1
2880-
fi
2881-
28822860
echo "--- Installing ${product} ---"
28832861
build_dir=$(build_directory ${host} ${product})
28842862

0 commit comments

Comments
 (0)