From 1747986a8881497aa43dec6c8691589a144fc1ac Mon Sep 17 00:00:00 2001 From: Bilal Akhtar Date: Fri, 17 Dec 2010 13:47:48 +0300 Subject: [PATCH] pbuilder-dist: Override the default build result location if --buildresult is specified. --- debian/changelog | 4 ++++ pbuilder-dist | 8 +++++++- ubuntutools/builder.py | 13 ++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b7f708..b43445a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,10 @@ ubuntu-dev-tools (0.108) UNRELEASED; urgency=low [ Evan Broder ] * backportpackage: new script for testing backport requests in a PPA. + [ Bilal Akhtar ] + * pbuilder-dist: Override the default build result location if + --buildresult is specified. + -- Benjamin Drung Thu, 16 Dec 2010 23:40:14 +0100 ubuntu-dev-tools (0.107) experimental; urgency=low diff --git a/pbuilder-dist b/pbuilder-dist index d34b188..31009db 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -177,7 +177,13 @@ class pbuilder_dist: + self.build_architecture) prefix = os.path.join(self.base, self.chroot_string) - result = '%s_result/' % prefix + if '--buildresult' not in remaining_arguments: + result = '%s_result/' % prefix + else: + location_of_arg = remaining_arguments.index('--buildresult') + result = remaining_arguments[location_of_arg+1] + remaining_arguments.pop(location_of_arg+1) + remaining_arguments.pop(location_of_arg) if not self.logfile and self.operation != 'login': self.logfile = os.path.normpath('%s/last_operation.log' % result) diff --git a/ubuntutools/builder.py b/ubuntutools/builder.py index e15a534..6876e88 100644 --- a/ubuntutools/builder.py +++ b/ubuntutools/builder.py @@ -50,6 +50,15 @@ class Pbuilder(Builder): Logger.command(cmd) return subprocess.call(cmd) +class Pbuilderdist(Builder): + def __init__(self): + Builder.__init__(self, "pbuilder-dist") + + def build(self, dsc_file, dist, result_directory): + cmd = ["pbuilder-dist", dist, self.architecture, + "build", dsc_file, "--buildresult", result_directory] + Logger.command(cmd) + return subprocess.call(cmd) class Sbuild(Builder): def __init__(self): @@ -74,8 +83,10 @@ def getBuilder(builder=None): if builder == 'pbuilder': return Pbuilder() + elif builder == 'pbuilder-dist': + return Pbuilderdist() elif builder == 'sbuild': return Sbuild() - Logger.error("Unsupported builder specified: %s. Only pbuilder and " + Logger.error("Unsupported builder specified: %s. Only pbuilder, pbuilder-dist and " "sbuild are supported." % builder)