[buildd-tools-devel] Bug#559533: sbuild: does not support new source formats

Andres Mejia mcitadel at gmail.com
Sat Dec 5 07:16:18 UTC 2009


Package: sbuild
Version: 0.59.0-1
Severity: normal


sbuild does not support the new source formats. The following patch fixes this.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sbuild depends on:
ii  adduser                       3.111      add and remove users and groups
ii  libsbuild-perl                0.59.1~rc1 Tool for building Debian binary pa
ii  perl                          5.10.1-8   Larry Wall's Practical Extraction 
ii  perl-modules                  5.10.1-8   Core Perl modules

Versions of packages sbuild recommends:
ii  debootstrap                   1.0.20     Bootstrap a basic Debian system
ii  fakeroot                      1.14.4-1   Gives a fake root environment

Versions of packages sbuild suggests:
pn  deborphan                     <none>     (no description available)
ii  wget                          1.12-1.1   retrieves files from the web

-- no debconf information
-------------- next part --------------
>From 36ddca05ea45e8050acb9a0c1ff9d2fcf45774da Mon Sep 17 00:00:00 2001
From: Andres Mejia <mcitadel at gmail.com>
Date: Sat, 5 Dec 2009 02:09:58 -0500
Subject: [PATCH] Allow sbuild to support new source format.

---
 lib/Sbuild/Build.pm |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 6aae838..479ad32 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -572,7 +572,7 @@ sub fetch_source_files {
 
     $dsctext =~ /^Files:\s*\n((\s+.*\s*\n)+)/mi and $files = $1;
     @other_files = map { (split( /\s+/, $_ ))[3] } split( "\n", $files );
-    $files =~ /(\Q$pkg\E.*orig.tar.gz)/mi and $orig = $1;
+    $files =~ /(\Q$pkg\E\.(?:orig\.)?tar\.[a-z\d]+)$/mi and $orig = $1;
 
     $self->log_subsubsection("Check arch");
     if (!$dscarchs) {
@@ -2375,7 +2375,21 @@ sub fixup_pkgv {
     my $pkgv = shift;
 
     $pkgv =~ s,^.*/,,; # strip path
-    $pkgv =~ s/\.(dsc|diff\.gz|tar\.gz|deb)$//; # strip extension
+    $pkgv =~ s{
+        \. # strip the preceding dot
+        (  # for grouping the variuos suffixes
+            dsc| # a dsc
+            deb| # or deb
+            diff\.gz| # or diff.gz
+            ( # or some tarball
+                orig # orig
+                (-[\w-]+)? # followed by component part 0 or 1 time
+                \. # followed by a dot
+            )? # matches 0 time for native, 1 time for upstream
+            tar # tar portion
+            \.[a-z\d]+ # matches any extension like gz, bz2, etc.
+        )$ # must be at the end of the line
+        }{}x; # strip extension
     $pkgv =~ s/_[a-zA-Z\d+~-]+\.(changes|deb)$//; # strip extension
 
     return $pkgv;
@@ -2510,8 +2524,10 @@ sub dsc_files {
     my $stanza = @{$stanzas}[0];
 
     # We're only interested in the name of the files in the Files field.
+    my $source = ${$stanza}{'Source'};
+    $source =~ s/\s+//msg;
     my $entry = ${$stanza}{'Files'};
-    @files = grep(/\.tar\.gz$|\.diff\.gz$/, split(/\s/, $entry));
+    @files = grep(/$source/, split(/\s+/, $entry));
 
     return @files;
 }
-- 
1.6.5.4



More information about the Buildd-tools-devel mailing list