From 7f6b8abcba26ba0653d80e9f81770e8c747e6181 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Fri, 4 Jul 2014 12:04:13 +0200 Subject: [PATCH] debian_build.py: Use re for partial substitution. --- debian_build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian_build.py b/debian_build.py index 548e5be..a9c90fd 100755 --- a/debian_build.py +++ b/debian_build.py @@ -347,7 +347,7 @@ if __name__ == '__main__': pattern = "{debversion}~develop{time:%Y%m%d+%H%M}+{build}+{git-commit}" else: pattern = "{debversion}+develop{time:%Y%m%d+%H%M}+{build}+{git-commit}" - pattern = pattern.format(build=ENV['BUILD_NUMBER']) + options.version_suffix + pattern = re.sub('{build}', ENV['BUILD_NUMBER'], pattern) + options.version_suffix new_version = version_substitution(logger, pattern, curr_commit) pb_suite = 'develop-{dist}'.format(dist=curr_dist) reprepro_base = '/srv/pb-{dist}'.format(dist=curr_dist) @@ -375,7 +375,7 @@ if __name__ == '__main__': pattern = "{debversion}~experimental{time:%Y%m%d+%H%M}+{build}+{git-commit}" else: pattern = "{debversion}+experimental{time:%Y%m%d+%H%M}+{build}+{git-commit}" - pattern = pattern.format(build=ENV['BUILD_NUMBER']) + options.version_suffix + pattern = re.sub('{build}', ENV['BUILD_NUMBER'], pattern) + options.version_suffix new_version = version_substitution(logger, pattern, curr_commit) reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist) apt_dist = curr_dist + "-" + local_branch.replace("/", "-") -- 2.39.5