Backport #876 from trunk: 1.2
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 27 14:28:36 2008 +0000 (2008-07-27)
branch1.2
changeset 7398ebf5ea601d8
parent 733 f1257533021a
child 742 0aabeb36e6ae
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(-)
scripts/functions
     1.1 --- a/scripts/functions	Sat Jul 26 15:16:40 2008 +0000
     1.2 +++ b/scripts/functions	Sun Jul 27 14:28:36 2008 +0000
     1.3 @@ -635,13 +635,17 @@
     1.4      esac
     1.5  
     1.6      CT_DoLog DEBUG "  Saving environment and aliases"
     1.7 -    # We must omit shell functions
     1.8 +    # We must omit shell functions, and some specific bash variables
     1.9 +    # that break when restoring the environment, later. We could do
    1.10 +    # all the processing in the awk script, but a sed is easier...
    1.11      set |awk '
    1.12 -         BEGIN { _p = 1; }
    1.13 -         $0~/^[^ ]+ \(\)/ { _p = 0; }
    1.14 -         _p == 1
    1.15 -         $0 == "}" { _p = 1; }
    1.16 -         ' >"${state_dir}/env.sh"
    1.17 +             BEGIN { _p = 1; }
    1.18 +             $0~/^[^ ]+ \(\)/ { _p = 0; }
    1.19 +             _p == 1
    1.20 +             $0 == "}" { _p = 1; }
    1.21 +             ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
    1.22 +                           /^(UID|EUID)=/d;
    1.23 +                           /^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh"
    1.24  
    1.25      CT_DoLog DEBUG "  Saving CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
    1.26      CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"