summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-08-19 22:33:23 (GMT)
committerAlexey Neyman <stilor@att.net>2017-08-21 15:41:14 (GMT)
commitb75f03146218a09a2882d5ecbb8130dac1fc7ab9 (patch)
tree8d14d85e53672b24baf6c104152641636a66a56f
parentb99b5288e762970d4b52c7c7b709bc725aa99edf (diff)
Check for config file changes when restarting
Also, save/restore per-target source directory. Fixes #800. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--scripts/crosstool-NG.sh.in2
-rw-r--r--scripts/functions7
2 files changed, 8 insertions, 1 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index bd07c6b..3d9a34e 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -651,7 +651,7 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
else
CT_DoSaveState ${step}
if [ ${do_stop} -eq 1 ]; then
- CT_DoLog ERROR "Stopping just after step '${prev_step}', as requested."
+ CT_DoLog INFO "Stopping just after step '${prev_step}', as requested."
exit 0
fi
fi
diff --git a/scripts/functions b/scripts/functions
index 147de34..ce99a17 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1052,7 +1052,10 @@ CT_DoSaveState() {
/^(UID|EUID)=/d;
/^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh"
+ CT_DoExecLog STATE cp ".config" "${state_dir}/config"
+
CT_DoTarballIfExists "${CT_BUILDTOOLS_PREFIX_DIR}" "${state_dir}/buildtools_dir"
+ CT_DoTarballIfExists "${CT_SRC_DIR}" "${state_dir}/src_dir"
CT_DoTarballIfExists "${CT_PREFIX_DIR}" "${state_dir}/prefix_dir" --exclude '*.log'
CT_DoLog STATE " Saving log file"
@@ -1073,10 +1076,14 @@ CT_DoLoadState(){
local old_STOP="${CT_STOP}"
CT_TestOrAbort "The previous build did not reach the point where it could be restarted at '${CT_RESTART}'" -d "${state_dir}"
+ if ! cmp ".config" "${state_dir}/config" >/dev/null 2>&1; then
+ CT_Abort "The configuration file has changed between two runs"
+ fi
CT_DoLog INFO "Restoring state at step '${state_name}', as requested."
CT_DoExtractTarballIfExists "${state_dir}/prefix_dir" "${CT_PREFIX_DIR}"
+ CT_DoExtractTarballIfExists "${state_dir}/src_dir" "${CT_SRC_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/buildtools_dir" "${CT_BUILDTOOLS_PREFIX_DIR}"
# Restore the environment, discarding any error message