]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build.py: Use re for partial substitution.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Fri, 4 Jul 2014 10:04:13 +0000 (12:04 +0200)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Fri, 4 Jul 2014 10:04:13 +0000 (12:04 +0200)
debian_build.py

index 548e5beb8c42b49edcb4c56b4266359597a2bbe9..a9c90fdeafac9a17ae38a6698164954aa70eb917 100755 (executable)
@@ -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("/", "-")