From 7cd0559ce812a70854a31e7ba6fa8ba7298e95b5 Mon Sep 17 00:00:00 2001 From: Deniz Bahadir Date: Fri, 1 May 2015 17:02:00 +0200 Subject: [PATCH] Fix / Workaround for issue #11224. (cont.) * Corrected a small error in a regex of "boost_mpl_preprocess.py" which did match too much and therefore resulted in wrong substitution in some cases. * Added some more directories with files that need fixing to script "fix_boost_mpl_preprocess.py". Signed-off-by: Deniz Bahadir --- preprocessed/boost_mpl_preprocess.py | 4 ++-- preprocessed/fix_boost_mpl_preprocess.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/preprocessed/boost_mpl_preprocess.py b/preprocessed/boost_mpl_preprocess.py index a51e3f9..ff26599 100755 --- a/preprocessed/boost_mpl_preprocess.py +++ b/preprocessed/boost_mpl_preprocess.py @@ -31,7 +31,7 @@ def create_more_container_files(sourceDir, suffix, maxElements, containers, cont for line in fileinput.input( newFile, inplace=1, mode="rU" ): line = re.sub(r'20', re.escape(str(i+10)), line.rstrip()) line = re.sub(r'11', re.escape(str(i + 1)), line.rstrip()) - line = re.sub(r'10', re.escape(str(i)), line.rstrip()) + line = re.sub(r'10(?![0-9])', re.escape(str(i)), line.rstrip()) print(line) for container in containers2: for i in range(20, maxElements, 10): @@ -42,7 +42,7 @@ def create_more_container_files(sourceDir, suffix, maxElements, containers, cont for line in fileinput.input( newFile, inplace=1, mode="rU" ): line = re.sub(r'20', re.escape(str(i+10)), line.rstrip()) line = re.sub(r'11', re.escape(str(i + 1)), line.rstrip()) - line = re.sub(r'10', re.escape(str(i)), line.rstrip()) + line = re.sub(r'10(?![0-9])', re.escape(str(i)), line.rstrip()) print(line) diff --git a/preprocessed/fix_boost_mpl_preprocess.py b/preprocessed/fix_boost_mpl_preprocess.py index 1f613ef..0dffd07 100755 --- a/preprocessed/fix_boost_mpl_preprocess.py +++ b/preprocessed/fix_boost_mpl_preprocess.py @@ -28,9 +28,12 @@ def fix_header_comment(filename, timestamp): print(line) -def fix_input_files_for_variadic_seq(sourceDir, timestamp): +def fix_input_files_for_variadic_seq(headerDir, sourceDir, timestamp): """Fixes files used as input when pre-processing MPL-containers in their variadic form.""" - files = glob.glob( os.path.join( sourceDir, "src", "*" ) ) + # Fix files in include/source-directories. + files = glob.glob( os.path.join( headerDir, "*.hpp" ) ) + files += glob.glob( os.path.join( headerDir, "aux_", "*.hpp" ) ) + files += glob.glob( os.path.join( sourceDir, "src", "*" ) ) for currentFile in sorted( files ): fix_header_comment( currentFile, timestamp ) @@ -51,7 +54,7 @@ def fix_input_files(headerDir, sourceDir, containers=['vector', 'list', 'set', ' # Fix the input files. if verbose: print "Fix input files for pre-processing Boost.MPL variadic containers." - fix_input_files_for_variadic_seq(sourceDir, timestamp) + fix_input_files_for_variadic_seq(headerDir, sourceDir, timestamp) if verbose: print "Fix input files for pre-processing Boost.MPL numbered containers." fix_input_files_for_numbered_seq(headerDir, ".hpp", timestamp, containers)