--- sbuild-0.60.0.orig/lib/Sbuild/Utility.pm
+++ sbuild-0.60.0/lib/Sbuild/Utility.pm
@@ -44,9 +44,11 @@
 use Time::HiRes qw ( time ); # Needed for high resolution timers
 
 sub get_dist ($);
-sub setup ($$);
+sub setup ($$$);
 sub cleanup ($);
 sub shutdown ($);
+sub parse_file ($);
+sub dsc_files ($);
 
 my $current_session;
 
@@ -56,7 +58,7 @@
 
     @ISA = qw(Exporter);
 
-    @EXPORT = qw(setup cleanup shutdown check_url download parse_file);
+    @EXPORT = qw(setup cleanup shutdown check_url download parse_file dsc_files);
 
     $SIG{'INT'} = \&shutdown;
     $SIG{'TERM'} = \&shutdown;
@@ -76,11 +78,11 @@
     return $dist;
 }
 
-sub setup ($$) {
+sub setup ($$$) {
+    my $namespace = shift;
     my $chroot = shift;
     my $conf = shift;
 
-
     $conf->set('VERBOSE', 1);
     $conf->set('NOLOG', 1);
 
@@ -96,7 +98,8 @@
 
     my $session;
 
-    $session = $chroot_info->create($chroot,
+    $session = $chroot_info->create($namespace,
+				    $chroot,
 				    undef, # TODO: Add --chroot option
 				    $conf->get('ARCH'));
 
@@ -358,7 +361,7 @@
 # It can also be used on files like Packages or Sources files in a Debian
 # archive.
 # This subroutine returns an array of hashes. Each hash is a stanza.
-sub parse_file {
+sub parse_file ($) {
     # Takes one parameter, the file to parse.
     my ($file) = @_;
 
@@ -420,4 +423,26 @@
     return \@array_of_fields;
 }
 
+sub dsc_files ($) {
+    my $dsc = shift;
+
+    my @files;
+
+    # The parse_file() subroutine returns a ref to an array of hashrefs.
+    my $stanzas = parse_file($dsc);
+
+    # A dsc file would only ever contain one stanza, so we only deal with
+    # the first entry which is a ref to a hash of fields for the stanza.
+    my $stanza = @{$stanzas}[0];
+
+    # We're only interested in the name of the files in the Files field.
+    my $entry = ${$stanza}{'Files'};
+
+    foreach my $line (split("\n", $entry)) {
+	push @files, $1 if $line =~ /(\S+)\s*$/;
+    }
+
+    return @files;
+}
+
 1;
