From 7057f45317eb3e6b525ff74c863424b8c33ff196 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 28 Jan 2013 21:53:18 +0100 Subject: scripts: fix finishing the toolchain when download/extract-only is set In case we only download or extract the sources, do not fail while finishing the toolchain: the test-suite directory may not exist, so we can't chmod it. Also, use safer constructs that won't trigger the 'set -e' in case of failure (eg.: "[ ... ] && ..." is not safe in case the test fails). Signed-off-by: "Yann E. MORIN" diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 177676c..b6bfeb4 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -659,7 +659,12 @@ if [ "${CT_LOG_TO_FILE}" = "y" ]; then bzip2 -9 "${CT_PREFIX_DIR}/build.log" fi fi -[ "${CT_INSTALL_DIR_RO}" = "y" ] && chmod -R a-w "${CT_INSTALL_DIR}" -[ "${CT_TEST_SUITE}" = "y" ] && chmod -R u+w "${CT_TEST_SUITE_DIR}" +if [ "${CT_INSTALL_DIR_RO}" = "y" ]; then + chmod -R a-w "${CT_INSTALL_DIR}" +fi +# CT_TEST_SUITE_DIR may not exist if only downloading or extracting +if [ "${CT_TEST_SUITE}" = "y" -a -d "${CT_TEST_SUITE_DIR}" ]; then + chmod -R u+w "${CT_TEST_SUITE_DIR}" +fi trap - EXIT -- cgit v0.10.2-6-g49f6