From 5fa034799444a674bde3beeeb8ae1ec6e55793e2 Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Fri, 3 May 2013 14:29:30 +0200 Subject: [PATCH] some beautifying --- debian_build.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/debian_build.py b/debian_build.py index d3524ca..0c8db1e 100755 --- a/debian_build.py +++ b/debian_build.py @@ -234,7 +234,7 @@ if __name__ == '__main__': pb_suite = new_dist - # ACT III: do something actually + # ACT III: actually do something # .. do some housekeeping first if not do_cleanup: figlet('Cleanup skipped') @@ -262,7 +262,7 @@ if __name__ == '__main__': )] if len(files) > 0: - logger.debug('Delete previous upstream tarball(s)') + logger.info('Delete previous upstream tarball(s)') cmd = [BIN_SUDO, BIN_RM, '-v'] cmd.extend(files) ret = subprocess.Popen( @@ -278,7 +278,6 @@ if __name__ == '__main__': cmd = cmd, exitcode = ret )) - figlet('Cleanup OK') # .. update changelog if we trust the package if do_autoincrement: @@ -306,7 +305,6 @@ if __name__ == '__main__': ), ] - logger.debug('Executing "%s" ...' %(' '.join(cmd))) dch = subprocess.Popen( cmd, shell=False, @@ -325,19 +323,20 @@ if __name__ == '__main__': gitrepo.git.commit('-a', '-m', 'add new changelog entry') if ret: - raise Exception( - '"%s" returned with exitcode: %s' %(' '.join(cmd), ret)) + logger.debug('"{cmd}" returns {exitcode}.'.format( + cmd = cmd, + exitcode = ret + )) + raise Exception('Failed to update changelog.') # let me see the first two changelog entries: - line_counter = 0 - for line in fileinput.input('debian/changelog'): - if line.startswith(' --'): - line_counter += 1 - if line_counter <= 2: - print('debian/changelog: %s' %(line.rstrip('\n'))) - - + # TODO: use changelog python libs instead of DCH calls, see above + cl = changelog.Changelog() + cl.parse_changelog(open('debian/changelog')) + logger.info('New changelog:\n\n%s' %( + ''.join([block.__str__() for block in cl._blocks[0:2]]))) + # ACT IV: preparations are set, let's build gbp = git_buildpackage.GitBuildPackage( upstream_branch = ENV['GIT_BRANCH'], -- 2.39.5