scripts/functions
changeset 738 e8c68d0d1a0c
parent 726 8b628f8dc108
child 754 b13657cd64b3
     1.1 --- a/scripts/functions	Sat Jul 26 09:22:42 2008 +0000
     1.2 +++ b/scripts/functions	Sun Jul 27 14:25:19 2008 +0000
     1.3 @@ -636,13 +636,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}"