Remove egrep syntax emulation since it's not really needed.
authorZac Medico <zmedico@gentoo.org>
Thu, 6 Mar 2008 01:16:30 +0000 (01:16 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 6 Mar 2008 01:16:30 +0000 (01:16 -0000)
svn path=/main/trunk/; revision=9447

bin/ebuild.sh
bin/filter-bash-environment.py

index cfe22500603280bf707df9341953fe0860b90717..b33911d4df4937c3fb506dd4bd096bec8ca52a64 100755 (executable)
@@ -1424,9 +1424,9 @@ filter_readonly_variables() {
                SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
                SANDBOX_LOG SANDBOX_ON"
        filtered_vars="${readonly_bash_vars} ${READONLY_PORTAGE_VARS}
-               BASH_[_[:alnum:]]* PATH"
+               BASH_.* PATH"
        if hasq --filter-sandbox $* ; then
-               filtered_vars="${filtered_vars} SANDBOX_[_[:alnum:]]*"
+               filtered_vars="${filtered_vars} SANDBOX_.*"
        else
                filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
        fi
index 5e109295f0d16c001c6f932e0c9af47de5d01781..bac104f13d9753d0ca23a174a83c0f15fc6b3d43 100755 (executable)
@@ -5,12 +5,6 @@
 
 import os, re, sys
 
-egrep_compat_map = {
-       "[:alnum:]" : r'\w',
-       "[:digit:]" : r'\d',
-       "[:space:]" : r'\s',
-}
-
 here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
 func_start_re = re.compile(r'^[-\w]+\s*\(\)\s*$')
 func_end_re = re.compile(r'^\}$')
@@ -19,11 +13,6 @@ var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^export\s+)([^=\s]+)=("|\')?.
 close_quote_re = re.compile(r'(\\"|"|\')\s*$')
 readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+')
 
-def compile_egrep_pattern(s):
-       for k, v in egrep_compat_map.iteritems():
-               s = s.replace(k, v)
-       return re.compile(s)
-
 def have_end_quote(quote, line):
        """
        Check if the line has an end quote (useful for handling multi-line
@@ -104,10 +93,7 @@ if __name__ == "__main__":
                "names matching a given PATTERN " + \
                "while leaving bash function definitions and here-documents " + \
                "intact. The PATTERN is a space separated list of variable names" + \
-               " and it supports python regular expression syntax in addition to" + \
-               " [:alnum:], [:digit:], and [:space:] " + \
-               "character classes which will be automatically translated " + \
-               "for compatibility with egrep syntax."
+               " and it supports python regular expression syntax."
        usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
        from optparse import OptionParser
        parser = OptionParser(description=description, usage=usage)
@@ -124,5 +110,5 @@ if __name__ == "__main__":
 
        var_pattern = "^(%s)$" % "|".join(var_pattern)
        filter_bash_environment(
-               compile_egrep_pattern(var_pattern), file_in, file_out)
+               re.compile(var_pattern), file_in, file_out)
        file_out.flush()