# HG changeset patch # User "Yann E. MORIN" # Date 1359406398 -3600 # Node ID 20f2459b97bf5eb89e2f125e0aede9541e7fc049 # Parent efad82bf7b9bc9df41b4d909127129d57c200941 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 -r efad82bf7b9b -r 20f2459b97bf scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Thu Jan 24 22:37:31 2013 +0100 +++ b/scripts/crosstool-NG.sh.in Mon Jan 28 21:53:18 2013 +0100 @@ -659,7 +659,12 @@ 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