From 4a6a976bfff6d5dcf5a9dda56f6e547aaaae1093 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 3 Nov 2011 20:05:16 +0100 Subject: [PATCH] also add commit id to changelog for production-p-u builds --- debian_build.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/debian_build.py b/debian_build.py index 9abbcbd..30f1e8b 100755 --- a/debian_build.py +++ b/debian_build.py @@ -17,6 +17,7 @@ import platform import subprocess import time import urllib +import fileinput from glob import glob from ftplib import FTP from lib import git_helper @@ -422,14 +423,21 @@ if __name__ == '__main__': raise Exception( '"%s" returned with exitcode: %s' %(' '.join(cmd), ret) ) - - # we need to commit here else git-buildpackage will use the existing debian/changelog... - # TODO: Later we should investigate why the "--ignore-new" trick - # did not work! - cmd = ['/usr/bin/git', 'add', '-A'] - subprocess.check_call(cmd) - cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry'] - subprocess.check_call(cmd) + else: + line_counter = 0 + for line in fileinput.input('debian/changelog', inplace=1): + line_counter += 1 + if line_counter == 3: + print ' * Generated by jenkins build of %s' % git_helper.git_get_commit_id() + print line + + # we need to commit here else git-buildpackage will use the existing debian/changelog... + # TODO: Later we should investigate why the "--ignore-new" trick + # did not work! + cmd = ['/usr/bin/git', 'add', '-A'] + subprocess.check_call(cmd) + cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry'] + subprocess.check_call(cmd) if not GIT_COMMITTER_EMAIL: for commit in repo.commits(): -- 2.39.5