From: Markus Scherer Date: Tue, 30 Apr 2013 16:27:15 +0000 (+0000) Subject: ICU-10128 remove version suffixes from UCD files, so that they are easy to compare... X-Git-Tag: milestone-59-0-1~2924 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9dc52d6084a3b00f862a57c30ce6c14c7b69eed;p=icu ICU-10128 remove version suffixes from UCD files, so that they are easy to compare as a tree of files X-SVN-Rev: 33565 --- diff --git a/tools/unicode/py/preparseucd.py b/tools/unicode/py/preparseucd.py index d821200c1ca..56e115349a6 100755 --- a/tools/unicode/py/preparseucd.py +++ b/tools/unicode/py/preparseucd.py @@ -1556,9 +1556,17 @@ def PreprocessFiles(source_files, icu_src_root): } files_processed = set() for source_file in source_files: - basename = os.path.basename(source_file) + (folder, basename) = os.path.split(source_file) match = _file_version_re.match(basename) - if match: basename = match.group(1) + match.group(2) + if match: + new_basename = match.group(1) + match.group(2) + if new_basename != basename: + print "Removing version suffix from " + source_file + # ... so that we can easily compare UCD files. + new_source_file = os.path.join(folder, new_basename) + shutil.move(source_file, new_source_file) + basename = new_basename + source_file = new_source_file if basename in _files: print "Preprocessing %s" % basename if basename in files_processed: