clone 649521 -1 retitle -1 "dpkg-buildpackage -Ttarget" should call "dpkg-source --before-build" first quit
Robert Luberda wrote: > I've just came up with another reason why the current behavious is > wrong: let's imagine that maintainer modifies the clean action of > upstream's Makefile (see the latest bsd-mailx for example). Than a > `debuild clean' (or dpkg-buildpackage -Tclean) won't run the modified > clean target. Sounds like a bug. The DESCRIPTION section of the dpkg-buildpackage(1) manpage says: 1. It prepares the build environment by setting various environment variables (see ENVIRONMENT) and calls "dpkg-source --before-build" (unless -T or --target has been used). However, the OPTIONS section says: -Ttarget Calls "debian/rules target" after having setup the build environment and stops the package build process here. If --as-root is also given, then the command is executed as root (see -r). Note that official targets that are required to be run as root by the Debian policy do not need this option. Isn't calling "dpkg-source --before-build" part of setting up the build environment? --- man/dpkg-buildpackage.1 | 2 +- scripts/dpkg-buildpackage.pl | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/man/dpkg-buildpackage.1 b/man/dpkg-buildpackage.1 index 5410a20c..9619140f 100644 --- a/man/dpkg-buildpackage.1 +++ b/man/dpkg-buildpackage.1 @@ -13,7 +13,7 @@ consists of the following steps: .IP \fB1.\fP 3 It prepares the build environment by setting various environment variables (see \fBENVIRONMENT\fP) and calls \fBdpkg\-source -\-\-before\-build\fP (unless \fB\-T\fP or \fB\-\-target\fP has been used). +\-\-before\-build\fP. .IP \fB2.\fP 3 It checks that the build-dependencies and build-conflicts are satisfied (unless \fB\-d\fP is specified). diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index 50e61704..ccbc2a3d 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -344,11 +344,9 @@ 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"); -} +chdir('..') or syserr('chdir ..'); +withecho('dpkg-source', @source_opts, '--before-build', $dir); +chdir($dir) or syserr("chdir $dir"); if ($checkbuilddep) { if ($admindir) { -- 1.7.8.rc3 -- To UNSUBSCRIBE, email to debian-dpkg-bugs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org