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 <dbahadir@benocs.com>
This commit is contained in:
Deniz Bahadir
2015-05-01 17:02:00 +02:00
parent 95f79d95a5
commit 7cd0559ce8
2 changed files with 8 additions and 5 deletions

View File

@@ -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)

View File

@@ -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)