From: Benjamin Drung Date: Fri, 4 Jul 2014 10:04:13 +0000 (+0200) Subject: debian_build.py: Use re for partial substitution. X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=7f6b8abcba26ba0653d80e9f81770e8c747e6181;p=profitbricks%2Fjenkins-build-scripts.git debian_build.py: Use re for partial substitution. --- 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("/", "-")