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
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'^\}$')
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
"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)
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()