On Friday 23 October 2009 19:23:59 Andres Mejia wrote:
> Here are a new set of patches for some debuild like functionality
>  implemented directly in sbuild. Details of what's new is in the patch for
>  the man page but in short, sbuild would now be able to build from a
>  Debianized source package, run lintian after a build, and run external
>  commands before and after a build.
> 
> With this, the sbuild-debuild script and manpage can be removed.
> 

Something I forgot to include was cleaning the source directory before 
building the source packages. Here's a patch that fixes that.

-- 
Regards,
Andres
From 1b875836e8359de142b710fa4c39e65da57c9c16 Mon Sep 17 00:00:00 2001
From: Andres Mejia <mcita...@gmail.com>
Date: Tue, 27 Oct 2009 01:17:37 -0400
Subject: [PATCH 7/7] Clean the source dir before building a the source packages.

---
 lib/Sbuild/Build.pm |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index f6822c5..889185e 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -256,15 +256,19 @@ sub run {
     # Build the source package if given a Debianized source directory
     if ($self->get('Debian Source Dir')) {
 	$self->log_subsection("Build Source Package");
+	my $clean_command = $self->get_conf('FAKEROOT') . " debian/rules clean";
 	my $dpkg_source = $self->get_conf('DPKG_SOURCE');
-	my $command = "$dpkg_source -b";
-	$command .= " " . $self->get_conf('DPKG_SOURCE_OPT')
+	my $dpkg_source_command = "$dpkg_source -b";
+	$dpkg_source_command .= " " . $self->get_conf('DPKG_SOURCE_OPT')
 	    if ($self->get_conf('DPKG_SOURCE_OPT'));
-	$command .= " " . $self->get('Debian Source Dir');
-	$self->log_subsubsection("$command");
-	my $curdir = getcwd(); # In case we're inside the source dir
+	$dpkg_source_command .= " " . $self->get('Debian Source Dir');
+	my $curdir = getcwd(); # To get back to the directory we were in
+	chdir($self->get('Debian Source Dir'));
+	$self->log_subsubsection("$clean_command");
+	$self->run_command($clean_command, 1, 1);
 	chdir($self->get_conf('BUILD_DIR'));
-	$self->run_command($command, 1, 1);
+	$self->log_subsubsection("$dpkg_source_command");
+	$self->run_command($dpkg_source_command, 1, 1);
 	chdir($curdir);
     }
 
-- 
1.6.5

Reply via email to