From 93569bf0f4f596d2b700d27e3560ee4a08c2dfac Mon Sep 17 00:00:00 2001 From: Ori Levari Date: Fri, 13 Mar 2020 11:35:49 -0700 Subject: [PATCH] fix regex to populate dll version information correctly --- tools/ci_build/build.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 7751425544..e39f7955b2 100755 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -396,12 +396,11 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home build_number = os.getenv('Build_BuildNumber') source_version = os.getenv('Build_SourceVersion') if build_number and source_version: - build_matches = re.match(r"^(\d\d)(\d\d)(\d\d)-(\d\d)(\d\d)\.(\d)\.(\S+)$", build_number) + build_matches = re.fullmatch(r"(\d\d)(\d\d)(\d\d)(\d\d)\.(\d+)", build_number) if build_matches: - YY = build_matches.group(1) - MM = build_matches.group(2) - DD = build_matches.group(3) - HH = build_matches.group(4) + YY = build_matches.group(2) + MM = build_matches.group(3) + DD = build_matches.group(4) # Get ORT major and minor number with open(os.path.join(source_dir, 'VERSION_NUMBER')) as f: @@ -419,8 +418,8 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home # String = 191101-2300.1.master.0bce7ae cmake_args += ["-DVERSION_MAJOR_PART={}".format(ort_major), "-DVERSION_MINOR_PART={}".format(ort_minor), - "-DVERSION_BUILD_PART={}{}".format(YY, MM), - "-DVERSION_PRIVATE_PART={}{}".format(DD, HH), + "-DVERSION_BUILD_PART={}".format(YY), + "-DVERSION_PRIVATE_PART={}{}".format(MM, DD), "-DVERSION_STRING={}.{}.{}.{}".format(ort_major, ort_minor, build_number, source_version[0:7])] for config in configs: