import subprocess
import time
import urllib
+import fileinput
from glob import glob
from ftplib import FTP
from lib import git_helper
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():