summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2013-01-28 20:53:18 (GMT)
committerYann E. MORIN" <yann.morin.1998@free.fr>2013-01-28 20:53:18 (GMT)
commit7057f45317eb3e6b525ff74c863424b8c33ff196 (patch)
tree1cb0e529af4b6fb7081519d96388176cf5c3805b
parent81c28d831b5dbd5aa9456defec8aa818bb6e0c0e (diff)
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>
-rw-r--r--scripts/crosstool-NG.sh.in9
1 files changed, 7 insertions, 2 deletions
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