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" <yann.morin.1998@free.fr>
This commit is contained in:
Yann E. MORIN" 2013-01-28 21:53:18 +01:00
parent 81c28d831b
commit 7057f45317

View File

@ -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