summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2017-01-04 11:04:47 -0500
committerDavid Neto <dneto@google.com>2017-01-06 13:18:50 -0500
commit558ac1e5aa25fa64c55304c7365b1a956cd1f81c (patch)
tree469bf435196c6a7aa1bc15a081797668aebad4d4 /utils
parent20b2035f2005a54fc1a499e884404f2209b0f317 (diff)
Allow trailing whitespace on version lines in CHANGES
Diffstat (limited to 'utils')
-rwxr-xr-xutils/update_build_version.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/update_build_version.py b/utils/update_build_version.py
index 95e42379..e8b0ace4 100755
--- a/utils/update_build_version.py
+++ b/utils/update_build_version.py
@@ -76,7 +76,11 @@ def deduce_software_version(directory):
The CHANGES file describes most recent versions first.
"""
- pattern = re.compile(r'(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d$')
+ # Match the first well-formed version-and-date line.
+ # Allow trailing whitespace in the checked-out source code has
+ # unexpected carriage returns on a linefeed-only system such as
+ # Linux.
+ pattern = re.compile(r'^(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d\s*$')
changes_file = os.path.join(directory, 'CHANGES')
with open(changes_file, mode='rU') as f:
for line in f.readlines():