import optparse
import os
import re
+import socket
import subprocess
import sys
from pprint import pformat
if ret:
build_failed = True
logger.error('sbuild failed with exitcode {code}'.format(code=ret))
+ # .. show instructions of how to get access to the build chroot
+ logger.info('''
+###
+### In case you need to analyze the results within chroot, do the following:
+### * login to {hostname}
+### * become user {jenkins_user} (or a user which belongs to the sbuild group)
+### * then execute:
+###
+
+cd {jenkins_workspace}
+{command}
+
+### Note: sbuild builds the Debian binary packages from the corresponding Debian source,
+### installing any missing source dependencies. The build takes place in a dedicated
+### clean build environment (chroot), rather than on the host system. If the build
+### fails, the chroot will be left for interrogation instead of removing it. You can
+### access the chroot with the schroot command. Please make sure to remove the chroot
+### after you are done.
+'''.format(hostname=socket.gethostname(),
+ jenkins_user=ENV['USER'],
+ jenkins_workspace=builder.dsc_dir,
+ command=' '.join(escape_arg(arg) for arg in builder.debug_command),
+ ))
figlet('Build failed')
failed_message = 'package build has failed'
do_cidb = False
@property
def command(self):
+ return self.command([])
+
+ @property
+ def get_command(self, additional_args):
'''
TODO
'''
'--arch=' + self.arch,
'-d', self.dist,
'-c', self.chroot
- ] + ['--extra-repository=' + repo for repo in self.additional_repos] + \
+ ] + ['--extra-repository=' + repo for repo in self.additional_repos] + additional_args + \
[self.dsc_file]
return result
+ @property
+ def debug_command(self):
+ return self.get_command(["--purge=successful"])
+
@property
def changes_file(self):
changes_filename = os.path.splitext(self.dsc_file)[0] + '_' + self.arch + '.changes'