diff options
author | 2004-11-20 14:18:32 +0000 | |
---|---|---|
committer | 2004-11-20 14:18:32 +0000 | |
commit | 9148e489cda11f8513b8a14fd9ffb3c70ee1e805 (patch) | |
tree | 9fd81471571a287c96ad81098bb91a7ca76792ac /bin | |
parent | fixups. (diff) | |
download | portage-cvs-9148e489cda11f8513b8a14fd9ffb3c70ee1e805.tar.gz portage-cvs-9148e489cda11f8513b8a14fd9ffb3c70ee1e805.tar.bz2 portage-cvs-9148e489cda11f8513b8a14fd9ffb3c70ee1e805.zip |
making filter-env active.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild.sh | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index cf734de..a8b03a3 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -2,7 +2,7 @@ # ebuild.sh; ebuild phase processing, env handling # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.208 2004/11/10 18:06:32 ferringb Exp $ +$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.209 2004/11/20 14:18:32 ferringb Exp $ #!/bin/bash # Gentoo Foundation @@ -63,6 +63,16 @@ killparent() { kill ${PORTAGE_MASTER_PID} } +convert_filter() { + while [ -n "$1" ]; do + echo -n "$1" + shift + if [ -n "$1" ]; then + echo -n ',' + fi + done +} + hasq() { local x @@ -146,52 +156,20 @@ get_vars() { dump_environ() { local f x; debug-print "dumping env" - declare | { - while read -r f && [ "${f#[^= ]* *\(\)}" == "$f" ]; do - echo "$f" - done; -# echo "stopped on $f" >&2 - } | egrep -v "^$(gen_filter ${DONT_EXPORT_VARS} f x y old_IFS)="; + declare | filter-env -f $(convert_filter ${DONT_EXPORT_FUNCS}) -v $(convert_filter ${DONT_EXPORT_VARS} f x) - save_IFS - - #can't just use which --read-functions, see bug #55522 -# echo "func_filter=$(gen_filter ${DONT_EXPORT_FUNCS} )" >&2 - declare -F | egrep -v " $(gen_filter ${DONT_EXPORT_FUNCS} )\$" | { - while read f; do - IFS='' -# echo "type '${f##* }'" >&2 - type "${f##* }" | { - #nuke the first line, which is "blah is a function" - read -r l - while read -r l; do - echo "$l" - done - } - unset IFS - done; - } - - restore_IFS - if ! hasq "--no-attributes" "$@"; then echo "reinstate_loaded_env_attributes ()" echo "{" -# x=`export | egrep -o '^declare +-[airtx]+ +[^=]+' | cut -s -d ' ' -f 3 | egrep -v "^$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` -# x=`export | cut -s -d '=' -f 1 | cut -s -d ' ' -f 3 | egrep -v "^$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` x=$(export | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)$") [ ! -z "$x" ] && echo " export `echo $x`" -# x=`readonly | egrep -o '^declare +-[airtx]+ +[^=]+'| cut -s -d ' ' -f 3 | egrep -v "^$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` -# x=`readonly | cut -s -d '=' -f 1 | cut -s -d ' ' -f 3 | egrep -v "^$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` x=$(readonly | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") [ ! -z "$x" ] && echo " readonly `echo $x`" -# x=`declare -i | egrep -o '^declare +-[airtx]+ +[^=]+' | cut -s -d ' ' -f 3 | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` -# x=`declare -i | cut -s -d '=' -f 1 | cut -s -d ' ' -f 3 | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)$"` x=$(declare -i | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") [ ! -z "$x" ] && echo " declare -i `echo $x`" @@ -285,7 +263,9 @@ load_environ() { } if [ -f "$src" ]; then eval "$({ [ "${src%.bz2}" != "${src}" ] && bzcat "$src" || cat "${src}" - } | egrep -v "^$(gen_filter $DONT_EXPORT_VARS)=")" + } | filter-env -v $(convert_filter ${DONT_EXPORT_VARS}) \ + -f $(convert_filter ${DONT_EXPORT_FUNCS}) )" +# } | egrep -v "^$(gen_filter $DONT_EXPORT_VARS)=")" else echo "ebuild=${EBUILD}, phase $EBUILD_PHASE" >&2 return 1 |