Make the sed expression in filter_readonly_variables() handle
authorZac Medico <zmedico@gentoo.org>
Fri, 23 Nov 2007 01:37:58 +0000 (01:37 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 23 Nov 2007 01:37:58 +0000 (01:37 -0000)
'^declare -r ' by simply removing it.

svn path=/main/trunk/; revision=8611

bin/ebuild.sh

index 20d08e3e3ddf2e9661ca202732a9d947225cf5c9..8124a15114acce4d4ab054662885f5b2f4305e5d 100755 (executable)
@@ -1394,7 +1394,9 @@ filter_readonly_variables() {
        # listed in READONLY_EBUILD_METADATA, since having any readonly attributes
        # persisting in the saved environment can be inconvenient when it
        # eventually needs to be reloaded.
-       egrep -v -e "${var_grep}" | sed 's:^declare[[:space:]]\+-\([[:alnum:]]*\)r\([[:alnum:]]*\)[[:space:]]\+:declare -\1\2 :'
+       egrep -v -e "${var_grep}" | sed \
+               -e 's:^declare[[:space:]]\+-r[[:space:]]\+::' \
+               -e 's:^declare[[:space:]]\+-\([[:alnum:]]*\)r\([[:alnum:]]*\)[[:space:]]\+:declare -\1\2 :'
 }
 
 # @FUNCTION: preprocess_ebuild_env