summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-27 14:25:19 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-27 14:25:19 (GMT)
commit8e512f9a95ed6ef31d1b38e5f2f01dc44930a411 (patch)
treef117f1876bc4abd43abdea0feb2b16f033caf86d /scripts/functions
parent66e2db8dad073ed3d98a6dec6f8831fadd67ea12 (diff)
Re-enable the restart functionality by removing some variables from the saved environment.
/trunk/scripts/functions | 16 10 6 0 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/functions b/scripts/functions
index c07c336..d71a340 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -636,13 +636,17 @@ CT_DoSaveState() {
esac
CT_DoLog DEBUG " Saving environment and aliases"
- # We must omit shell functions
+ # We must omit shell functions, and some specific bash variables
+ # that break when restoring the environment, later. We could do
+ # all the processing in the awk script, but a sed is easier...
set |awk '
- BEGIN { _p = 1; }
- $0~/^[^ ]+ \(\)/ { _p = 0; }
- _p == 1
- $0 == "}" { _p = 1; }
- ' >"${state_dir}/env.sh"
+ BEGIN { _p = 1; }
+ $0~/^[^ ]+ \(\)/ { _p = 0; }
+ _p == 1
+ $0 == "}" { _p = 1; }
+ ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
+ /^(UID|EUID)=/d;
+ /^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh"
CT_DoLog DEBUG " Saving CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"