From 04d22dca1b1f7e679efa3a83cdcd9fdc05a6f67e Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Thu, 24 Jul 2014 01:17:40 +0200 Subject: [PATCH] debian_build.py: Run sbuild with -n (for getting output) and fix sbuild work directory --- debian_build.py | 3 ++- lib/sbuild.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian_build.py b/debian_build.py index f7d4644..a4692a0 100755 --- a/debian_build.py +++ b/debian_build.py @@ -605,7 +605,8 @@ if __name__ == '__main__': ) if ret == 0: logger.info('Current environment:\n\n{env}\n'.format(env=builder.env)) - logger.info('Start building the binary package with sbuild...\n') + logger.info('Start building the binary package by running ' + '"{cmd}"...\n'.format(cmd=' '.join(builder.command))) ret = builder.build() # .. remove last commit (the one where we added the changelog entry) diff --git a/lib/sbuild.py b/lib/sbuild.py index 82e8957..521099c 100644 --- a/lib/sbuild.py +++ b/lib/sbuild.py @@ -15,7 +15,8 @@ class Sbuild(object): ''' TODO ''' - self.dsc_file = dsc_file + self.dsc_dir = os.path.dirname(dsc_file) + self.dsc_file = os.path.basename(dsc_file) self.arch = arch self.chroot = chroot self.dist = dist @@ -35,9 +36,10 @@ class Sbuild(object): ''' result = [ SBUILD, + '-n', + '--arch=' + self.arch, '-d', self.dist, '-c', self.chroot, - '--arch=' + self.arch, self.dsc_file, ] return result @@ -64,8 +66,9 @@ class Sbuild(object): #stderr=subprocess.PIPE, stdout=sys.stdout, stderr=sys.stderr, + bufsize=0, env=self.env, - cwd=os.getcwd(), + cwd=self.dsc_dir, ) ret = cmdobj.wait() -- 2.39.5