diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-27 14:28:36 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-07-27 14:28:36 +0000 |
commit | f37915ff064c466e275683b7b429db9ba5caa23b (patch) | |
tree | acd3d9d7cf05a12cf11b72f2f7d58d292ea2ff2c | |
parent | b520c7f9c455f830abf91067f448e997275d4bf4 (diff) | |
download | crosstool-ng-f37915ff064c466e275683b7b429db9ba5caa23b.tar.gz crosstool-ng-f37915ff064c466e275683b7b429db9ba5caa23b.tar.bz2 crosstool-ng-f37915ff064c466e275683b7b429db9ba5caa23b.zip |
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/functions | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/functions b/scripts/functions index cc2f3003..f0db2b85 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}" |