From 33ac92965f17401fc02093f2363100ff2ed9734d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 6 Mar 2008 01:16:30 +0000 Subject: Remove egrep syntax emulation since it's not really needed. svn path=/main/trunk/; revision=9447 --- bin/ebuild.sh | 4 ++-- bin/filter-bash-environment.py | 18 ++---------------- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'bin') diff --git a/bin/ebuild.sh b/bin/ebuild.sh index cfe225006..b33911d4d 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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 diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py index 5e109295f..bac104f13 100755 --- a/bin/filter-bash-environment.py +++ b/bin/filter-bash-environment.py @@ -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() -- cgit v1.2.3-1-g7c22