[buildd-tools-devel] Bug#886633: sbuild: Please, unapply quilt patches after the build.

Pierre-Elliott Bécue becue at crans.org
Mon Jan 8 09:52:05 UTC 2018


Package: sbuild
Version: 0.73.0-4
Severity: wishlist
Tags: patch pending

This is just a followup of a #debian-mentors conversation between josch
and myself.

My question was "is there a way to have sbuild unapply quilt patches
after the end of the build".

josch provided me a patch, which is working properly. This report is
there only as a dedicated communication channel and for tracking.

Thanks and cheers. :D

-- System Information:
Debian Release: 9.3
  APT prefers stable
  APT policy: (990, 'stable'), (99, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8), LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages sbuild depends on:
ii  adduser         3.115
ii  libsbuild-perl  0.73.0-4
ii  perl            5.24.1-3+deb9u2

Versions of packages sbuild recommends:
ii  autopkgtest  4.4
ii  debootstrap  1.0.89
ii  schroot      1.6.10-3+deb9u1

Versions of packages sbuild suggests:
pn  deborphan  <none>
ii  kmod       23-2
ii  wget       1.18-5+deb9u1

-- no debconf information
-------------- next part --------------
diff --git a/bin/sbuild b/bin/sbuild
index 84981d71..6acbd031 100755
--- a/bin/sbuild
+++ b/bin/sbuild
@@ -237,6 +237,16 @@ sub create_source_package ($) {
     chdir($dir) or Sbuild::Exception::Build->throw(
 	error => "Failed to change directory",
 	failstage => "pack-source");
+    my @dpkg_source_before = ($conf->get('DPKG_SOURCE'), '--before-build');
+    push @dpkg_source_before, @{$conf->get('DPKG_SOURCE_OPTIONS')}
+    if ($conf->get('DPKG_SOURCE_OPTIONS'));
+    push @dpkg_source_before, '.';
+    system(@dpkg_source_before);
+    if ($?) {
+	Sbuild::Exception::Build->throw(
+	    error => "Failed to run dpkg-source --before-build " . getcwd(),
+	    failstage => "pack-source");
+    }
     if ($conf->get('CLEAN_SOURCE')) {
 	system($conf->get('FAKEROOT'), 'debian/rules', 'clean');
 	if ($?) {
@@ -255,6 +265,16 @@ sub create_source_package ($) {
 	    error => "Failed to package source directory " . getcwd(),
 	    failstage => "pack-source");
     }
+    my @dpkg_source_after = ($conf->get('DPKG_SOURCE'), '--after-build');
+    push @dpkg_source_after, @{$conf->get('DPKG_SOURCE_OPTIONS')}
+    if ($conf->get('DPKG_SOURCE_OPTIONS'));
+    push @dpkg_source_after, '.';
+    system(@dpkg_source_after);
+    if ($?) {
+	Sbuild::Exception::Build->throw(
+	    error => "Failed to run dpkg-source --after-build " . getcwd(),
+	    failstage => "pack-source");
+    }
     chdir($origdir) or Sbuild::Exception::Build->throw(
 	error => "Failed to change directory",
 	failstage => "pack-source");
diff --git a/man/sbuild.1.in b/man/sbuild.1.in
index bdacb654..a7210508 100644
--- a/man/sbuild.1.in
+++ b/man/sbuild.1.in
@@ -407,7 +407,8 @@ This command line option appends to the \fBDPKG_SOURCE_OPTIONS\fP configuration
 .BR sbuild.conf (5)
 for more information.
 .br
-\fBNOTE:\fR The '\fI-b\fP' option will always be passed to dpkg-source.
+\fBNOTE:\fR The '\fI-b\fP', '\fI--before-build\fP' and '\fI--after-build\fP'
+options will always be passed to dpkg-source, respectively.
 .TP
 .BR \-\-dpkg\-source\-opts=\fIoptions\fP
 Pass the specified options directly to dpkg\-source in addition to the options
@@ -422,6 +423,9 @@ command line.
 This command line option appends to the \fBDPKG_SOURCE_OPTIONS\fP configuration variable. See
 .BR sbuild.conf (5)
 for more information.
+.br
+\fBNOTE:\fR The '\fI-b\fP', '\fI--before-build\fP' and '\fI--after-build\fP'
+options will always be passed to dpkg-source, respectively.
 .TP
 .BR "\-\-mail\-log\-to=\fIemail-address\fP"
 Send the build log to the specified email address.


More information about the Buildd-tools-devel mailing list