summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-27 14:28:36 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-27 14:28:36 (GMT)
commitf37915ff064c466e275683b7b429db9ba5caa23b (patch)
treeacd3d9d7cf05a12cf11b72f2f7d58d292ea2ff2c
parentb520c7f9c455f830abf91067f448e997275d4bf4 (diff)
Backport #876 from trunk:
Re-enable the restart functionality by removing some variables from the saved environment. /branches/1.2/scripts/functions | 16 10 6 0 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
-rw-r--r--scripts/functions16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/functions b/scripts/functions
index cc2f300..f0db2b8 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -635,13 +635,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}"