diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-05-20 00:54:08 -0500 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2010-05-20 08:08:48 +0200 |
commit | 5e9ddfc44109464cd0deefd69eb7375a66ed03d3 (patch) | |
tree | 62cbfaeb35916f9d37a9cf534d5cc2e374485d32 /scripts/dpkg-source.pl | |
parent | e6f6bb08f15b507ba1ae34ad274e6db76f13614d (diff) | |
download | dpkg-5e9ddfc44109464cd0deefd69eb7375a66ed03d3.tar.gz |
dpkg-source: do not ensure prerequisites are met for --before-build/--after-build
It is perfectly reasonable to use the before_build and after_build
hooks in situations where the source package is missing.
Without this change, attempts to build a package of format 3.0 (quilt)
with the upstream tarball missing result in errors.
$ dpkg-buildpackage -b
[...]
dpkg-source -I -i --before-build csound
dpkg-buildpackage: host architecture i386
dpkg-source: error: can't build with source format '3.0 (quilt)': no orig.tar file found
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
Diffstat (limited to 'scripts/dpkg-source.pl')
-rwxr-xr-x | scripts/dpkg-source.pl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index a5e29af0d..403f0fc4e 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -320,13 +320,7 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { if ($options{'opmode'} eq "--print-format") { print $fields->{'Format'} . "\n"; exit(0); - } - - # Verify pre-requesites are met - my ($res, $msg) = $srcpkg->can_build($dir); - error(_g("can't build with source format '%s': %s"), $build_format, $msg) unless $res; - - if ($options{'opmode'} eq "--before-build") { + } elsif ($options{'opmode'} eq "--before-build") { $srcpkg->before_build($dir); exit(0); } elsif ($options{'opmode'} eq "--after-build") { @@ -334,6 +328,10 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { exit(0); } + # Verify pre-requisites are met + my ($res, $msg) = $srcpkg->can_build($dir); + error(_g("can't build with source format '%s': %s"), $build_format, $msg) unless $res; + # Only -b left info(_g("using source format `%s'"), $fields->{'Format'}); run_vendor_hook("before-source-build", $srcpkg); |