diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-08-14 12:30:02 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-08-14 12:30:02 -0500 |
commit | 3d24204ff546ab1b3ed9c330e647594c1f2dda43 (patch) | |
tree | e180ed6dac6154526ef896a71499ccda327ef43f /ACE/bin | |
parent | 24b0a422d6a39501fe0b56d79704dd552a314e45 (diff) | |
download | ATCD-3d24204ff546ab1b3ed9c330e647594c1f2dda43.tar.gz |
make_release.py: Fix PRF Version RegEx
Diffstat (limited to 'ACE/bin')
-rwxr-xr-x | ACE/bin/make_release.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ACE/bin/make_release.py b/ACE/bin/make_release.py index 9c33ade396c..d3b988516a9 100755 --- a/ACE/bin/make_release.py +++ b/ACE/bin/make_release.py @@ -48,6 +48,8 @@ cpu_count = multiprocessing.cpu_count() """ This is a regex that detects files that SHOULD NOT have line endings converted to CRLF when being put into a ZIP file """ bin_regex = re.compile ("\.(mak|mdp|ide|exe|ico|gz|zip|xls|sxd|gif|vcp|vcproj|vcw|sln|dfm|jpg|png|vsd|bz2|pdf|ppt|graffle|pptx|odt|sh)$") +version_restr = r'(\d+)(?:\.(\d+)(?:\.(\d+))?)?' +version_re = re.compile(version_restr) ################################################## #### Utility Methods @@ -244,19 +246,17 @@ def update_version_files (component): # Update component/PROBLEM-REPORT-FORM vprint ("Updating PRF for " + component) - version_string = re.compile ("^\s*(\w+) +VERSION ?:") + version_line_re = re.compile (r"^\s*(\w+) +VERSION ?:") path = get_path(component, "PROBLEM-REPORT-FORM") with open (path, 'r+') as prf: new_prf = "" for line in prf.readlines (): - match = None - match = version_string.search (line) + match = version_line_re.search (line) if match is not None: vprint ("Found PRF Version for " + match.group (1)) - line = re.sub ("(\d\.)+\d?", - comp_versions[match.group(1) + "_version"], - line) + new_version = comp_versions[match.group(1) + "_version"] + line = version_re.sub (new_version, line) new_prf += line @@ -379,7 +379,7 @@ def get_comp_versions (component): requested.""" vprint ("Detecting current version for " + component) - regex = re.compile ("version (\d+)(?:\.(\d+)(?:\.(\d+))?)?") + regex = re.compile (r"version " + version_restr) major = component + "_major" minor = component + "_minor" micro = component + "_micro" |