pb_suite=pb_suite,
git_commit_id=curr_commit_id[0:7],
)
- logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))
- logger.info('Start building the binary package with pbuilder...\n')
- ret = builder.build()
+ if ret == 0:
+ logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))
+ logger.info('Start building the binary package with pbuilder...\n')
+ ret = builder.build()
# .. remove last commit (the one where we added the changelog entry)
# FIXME: when 'merge': reset only on original branch?
# gitpkg-exit-hook is stored in the same directory than the
# debian_build.py script.
base_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
- config_writer = self.gitrepo.config_writer()
- config_writer.set_value('gitpkg', 'create-fake-orig', 'true')
- config_writer.set_value('gitpkg', 'gitpkg.exit-hook',
- os.path.join(base_dir, 'gitpkg-exit-hook'))
+
+ if hasattr(self.gitrepo,'config_writer'):
+ # this requires python-git >= 0.2
+ config_writer = self.gitrepo.config_writer()
+ config_writer.set_value('gitpkg', 'create-fake-orig', 'true')
+ config_writer.set_value('gitpkg', 'exit-hook',
+ os.path.join(base_dir, 'gitpkg-exit-hook'))
+ # unset prebuild target for gitpkg < 0.18
+ config_writer.set_value('gitpkg', 'prebuild-target', '')
+ else:
+ # FIXME: upgrade python-git or make me fail safe
+ cmd = ['git', 'config', 'gitpkg.create-fake-orig', 'true']
+ subprocess.check_call(cmd)
+ cmd = ['git', 'config', 'gitpkg.exit-hook',
+ os.path.join(base_dir, 'gitpkg-exit-hook')]
+ subprocess.check_call(cmd)
+ # unset prebuild target for gitpkg < 0.18
+ cmd = ['git', 'config', 'gitpkg.prebuild-target', '']
+ subprocess.check_call(cmd)
cmdobj = subprocess.Popen(
self.command,
dsc_file = None
debian_dsc = os.path.join(os.getcwd(), "../debian_dsc")
if os.path.isfile(debian_dsc):
- dsc_file = open(debian_dsc).read()
+ dsc_file = open(debian_dsc).read().strip()
if not os.path.isfile(dsc_file):
logger.error("Generated source package " + dsc_file +
" not found.")
import sys
import subprocess
-BIN_PBUILDER = '/usr/bin/pbuilder'
+BIN_PBUILDER = '/usr/sbin/pbuilder'
BIN_SUDO = '/usr/bin/sudo'
class Pbuilder(object):
BIN_SUDO,
BIN_PBUILDER,
'--build',
- '--buildresult=../build-area/result/',
+ '--buildresult', '../build-area/result/',
'--debbuildopts', '-b', # don't build source packages...
# see directly below
self.dsc_file,