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')
)]
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(
cmd = cmd,
exitcode = ret
))
- figlet('Cleanup OK')
# .. update changelog if we trust the package
if do_autoincrement:
),
]
- logger.debug('Executing "%s" ...' %(' '.join(cmd)))
dch = subprocess.Popen(
cmd,
shell=False,
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'],