Просмотр исходного кода

dpkg-buildpackage: add calls to dpkg-source --before-build and --after-build

Raphaël Hertzog лет назад: 16
Родитель
Сommit
9bbdfecf72
3 измененных файлов с 22 добавлено и 5 удалено
  1. 7 0
      debian/changelog
  2. 6 5
      man/dpkg-buildpackage.1
  3. 9 0
      scripts/dpkg-buildpackage.pl

+ 7 - 0
debian/changelog

@@ -1,5 +1,12 @@
 dpkg (1.15.8) UNRELEASED; urgency=low
 
+  [ Raphaël Hertzog ]
+  * Add new commands --before-build and --after-build to dpkg-source
+    and modify dpkg-buildpackage to call them automatically at the
+    start and at the end of the process. With "3.0 (quilt)" source packages
+    this ensures patches are applied even in case of binary-only builds.
+    Closes: #572526
+
   [ Updated programs translations ]
   * Russian (Yuri Kozlov). Closes: #579149
 

+ 6 - 5
man/dpkg-buildpackage.1

@@ -12,18 +12,19 @@ is a program that automates the process of building a Debian package. It
 consists of the following steps:
 .IP \fB1.\fP 3
 It prepares the build environment by setting various environment
-variables (see \fBENVIRONMENT\fP).
+variables (see \fBENVIRONMENT\fP) and calls \fBdpkg\-source
+\-\-before\-build\fP (unless \fB\-T\fP or \fB\-\-target\fP has been used).
 .IP \fB2.\fP 3
 It checks that the build-dependencies and build-conflicts
 are satisfied (unless \fB\-d\fP is specified).
 .IP \fB3.\fP 3
-If a specific target has been selected with the \fB-T\fP or \fB--target\fP
+If a specific target has been selected with the \fB\-T\fP or \fB\-\-target\fP
 option, it calls that target and stops here. Otherwise it calls
 \fBfakeroot debian/rules clean\fP to clean the build-tree (unless
 \fB\-nc\fP is specified).
 .IP \fB4.\fP 3
-It calls \fBdpkg-source\fP to generate the source package (unless
-a binary-only build has been requested with \fB\-b\fP, \fB\-B\fP or
+It calls \fBdpkg-source \-b\fP to generate the source package (unless
+a binary\-only build has been requested with \fB\-b\fP, \fB\-B\fP or
 \fB\-A\fP).
 .IP \fB5.\fP 3
 It calls \fBdebian/rules\fP \fBbuild\fP followed by
@@ -44,7 +45,7 @@ It calls \fBgpg\fP to sign the \fB.changes\fP file (unless \fB\-uc\fP
 is specified).
 .IP \fB9.\fP 3
 If \fB\-tc\fP is specified, it will call \fBfakeroot debian/rules clean\fP
-again.
+again. Finally it calls \fBdpkg\-source \-\-after\-build\fP.
 .
 .SH OPTIONS
 .TP

+ 9 - 0
scripts/dpkg-buildpackage.pl

@@ -327,6 +327,12 @@ if (not -x "debian/rules") {
     chmod(0755, "debian/rules"); # No checks of failures, non fatal
 }
 
+unless ($call_target) {
+    chdir('..') or syserr('chdir ..');
+    withecho('dpkg-source', @source_opts, '--before-build', $dir);
+    chdir($dir) or syserr("chdir $dir");
+}
+
 if ($checkbuilddep) {
     if ($admindir) {
 	push @checkbuilddep_opts, "--admindir=$admindir";
@@ -449,6 +455,9 @@ if ($signchanges && signfile("$pva.changes")) {
 if ($cleansource) {
     withecho(@rootcommand, @debian_rules, 'clean');
 }
+chdir('..') or syserr('chdir ..');
+withecho('dpkg-source', @source_opts, '--after-build', $dir);
+chdir($dir) or syserr("chdir $dir");
 
 print "$progname: $srcmsg\n";
 if ($signerrors) {