Kaynağa Gözat

dpkg-checkbuilddeps: Add support for ignoring built-in build dependencies

There is currently no way to require that «Build-Essential: yes»
packages be installed, so on Debian-based systems we have to rely on
the build-essential metapackage, which is slightly wrong.

In addition users that know what they are doing, might want to disable
only the implicit build dependencies and conflicts, but not the entire
dependency checks, and there was no way to do that.

Add new «dpkg-buildpackage --ignore-builtin-builddeps» and
«dpkg-checkbuilddeps -I» options.

Closes: #480638, #571671
Guillem Jover 11 yıl önce
ebeveyn
işleme
98b3341f5f

+ 3 - 0
debian/changelog

@@ -8,6 +8,9 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     Reported by Niels Thykier <niels@thykier.net>.
     Reported by Niels Thykier <niels@thykier.net>.
   * Move the implicit build-essential:native Build-Depends from
   * Move the implicit build-essential:native Build-Depends from
     dpkg-checkbuilddeps to a new vendor hook, as it is Debian-specific.
     dpkg-checkbuilddeps to a new vendor hook, as it is Debian-specific.
+  * Add support for ignoring built-in build dependencies and conflicts
+    with the new «dpkg-buildpackage --ignore-builtin-builddeps» and
+    «dpkg-checkbuilddeps -I» options. Closes: #480638, #571671
   * Perl modules:
   * Perl modules:
     - Remove non-functional timezone name support from
     - Remove non-functional timezone name support from
       Dpkg::Changelog::Entry::Debian.
       Dpkg::Changelog::Entry::Debian.

+ 6 - 1
man/dpkg-buildpackage.1

@@ -19,7 +19,7 @@
 .\" You should have received a copy of the GNU General Public License
 .\" You should have received a copy of the GNU General Public License
 .\" along with this program.  If not, see <https://www.gnu.org/licenses/>.
 .\" along with this program.  If not, see <https://www.gnu.org/licenses/>.
 .
 .
-.TH dpkg\-buildpackage 1 "2013-12-12" "Debian Project" "dpkg utilities"
+.TH dpkg\-buildpackage 1 "2015-07-05" "Debian Project" "dpkg utilities"
 .SH NAME
 .SH NAME
 dpkg\-buildpackage \- build binary or source packages from sources
 dpkg\-buildpackage \- build binary or source packages from sources
 .
 .
@@ -213,6 +213,11 @@ default behavior.
 .B \-d
 .B \-d
 Do not check build dependencies and conflicts.
 Do not check build dependencies and conflicts.
 .TP
 .TP
+.B \-\-ignore\-builtin\-builddeps
+Do not check built-in build dependencies and conflicts (since dpkg 1.18.2).
+These are the distribution specific implicit build dependencies usually
+required in a build environment, the so called Build-Essential package set.
+.TP
 .B \-nc
 .B \-nc
 Do not clean the source tree (implies \fB\-b\fP if nothing else has been
 Do not clean the source tree (implies \fB\-b\fP if nothing else has been
 selected among \fB\-F\fP, \fB\-g\fP, \fB\-G\fP, \fB\-B\fP, \fB\-A\fP
 selected among \fB\-F\fP, \fB\-g\fP, \fB\-G\fP, \fB\-B\fP, \fB\-A\fP

+ 7 - 2
man/dpkg-checkbuilddeps.1

@@ -1,7 +1,7 @@
 .\" dpkg manual page - dpkg-checkbuilddeps(1)
 .\" dpkg manual page - dpkg-checkbuilddeps(1)
 .\"
 .\"
 .\" Copyright © 2001 Joey Hess <joeyh@debian.org>
 .\" Copyright © 2001 Joey Hess <joeyh@debian.org>
-.\" Copyright © 2007-2012 Guillem Jover <guillem@debian.org>
+.\" Copyright © 2007-2013, 2015 Guillem Jover <guillem@debian.org>
 .\" Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
 .\" Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
 .\"
 .\"
 .\" This is free software; you can redistribute it and/or modify
 .\" This is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 .\" You should have received a copy of the GNU General Public License
 .\" You should have received a copy of the GNU General Public License
 .\" along with this program.  If not, see <https://www.gnu.org/licenses/>.
 .\" along with this program.  If not, see <https://www.gnu.org/licenses/>.
 .
 .
-.TH dpkg\-checkbuilddeps 1 "2013-09-17" "Debian Project" "dpkg utilities"
+.TH dpkg\-checkbuilddeps 1 "2015-07-05" "Debian Project" "dpkg utilities"
 .SH NAME
 .SH NAME
 dpkg\-checkbuilddeps \- check build dependencies and conflicts
 dpkg\-checkbuilddeps \- check build dependencies and conflicts
 .
 .
@@ -51,6 +51,11 @@ Ignore \fBBuild\-Depends\-Indep\fP and \fBBuild\-Conflicts\-Indep\fP
 lines. Use when only arch-dep packages will be built, or combine with
 lines. Use when only arch-dep packages will be built, or combine with
 \fB\-A\fP when only a source package is to be built.
 \fB\-A\fP when only a source package is to be built.
 .TP
 .TP
+.B \-I
+Ignore built-in build depends and conflicts (since dpkg 1.18.2).
+These are implicit dependencies that are usually required on a specific
+distribution, the so called Build-Essential package set.
+.TP
 .BI "\-d " build-depends-string
 .BI "\-d " build-depends-string
 .TP
 .TP
 .BI "\-c " build-conflicts-string
 .BI "\-c " build-conflicts-string

+ 4 - 0
scripts/dpkg-buildpackage.pl

@@ -138,6 +138,7 @@ my $cleansource;
 my $parallel;
 my $parallel;
 my $parallel_force;
 my $parallel_force;
 my $checkbuilddep = 1;
 my $checkbuilddep = 1;
+my $check_builtin_builddep = 1;
 my @source_opts;
 my @source_opts;
 my $check_command = $ENV{DEB_CHECK_COMMAND};
 my $check_command = $ENV{DEB_CHECK_COMMAND};
 my @check_opts;
 my @check_opts;
@@ -259,6 +260,8 @@ while (@ARGV) {
 	$signkey = $1;
 	$signkey = $1;
     } elsif (/^-([dD])$/) {
     } elsif (/^-([dD])$/) {
 	$checkbuilddep = ($1 eq 'D');
 	$checkbuilddep = ($1 eq 'D');
+    } elsif (/^--ignore-builtin-builddeps$/) {
+	$check_builtin_builddep = 0;
     } elsif (/^-s(gpg|pgp)$/) {
     } elsif (/^-s(gpg|pgp)$/) {
 	# Deprecated option
 	# Deprecated option
 	warning(g_('-s%s is deprecated; always using gpg style interface'), $1);
 	warning(g_('-s%s is deprecated; always using gpg style interface'), $1);
@@ -502,6 +505,7 @@ if ($checkbuilddep) {
 
 
     push @checkbuilddep_opts, '-A' if ($include & BUILD_ARCH_DEP) == 0;
     push @checkbuilddep_opts, '-A' if ($include & BUILD_ARCH_DEP) == 0;
     push @checkbuilddep_opts, '-B' if ($include & BUILD_ARCH_INDEP) == 0;
     push @checkbuilddep_opts, '-B' if ($include & BUILD_ARCH_INDEP) == 0;
+    push @checkbuilddep_opts, '-I' if not $check_builtin_builddep;
     push @checkbuilddep_opts, "--admindir=$admindir" if $admindir;
     push @checkbuilddep_opts, "--admindir=$admindir" if $admindir;
 
 
     system('dpkg-checkbuilddeps', @checkbuilddep_opts);
     system('dpkg-checkbuilddeps', @checkbuilddep_opts);

+ 7 - 2
scripts/dpkg-checkbuilddeps.pl

@@ -47,6 +47,7 @@ sub usage {
 'Options:
 'Options:
   -A             ignore Build-Depends-Arch and Build-Conflicts-Arch.
   -A             ignore Build-Depends-Arch and Build-Conflicts-Arch.
   -B             ignore Build-Depends-Indep and Build-Conflicts-Indep.
   -B             ignore Build-Depends-Indep and Build-Conflicts-Indep.
+  -I             ignore built-in build dependencies and conflicts.
   -d build-deps  use given string as build dependencies instead of
   -d build-deps  use given string as build dependencies instead of
                  retrieving them from control file
                  retrieving them from control file
   -c build-conf  use given string for build conflicts instead of
   -c build-conf  use given string for build conflicts instead of
@@ -64,6 +65,7 @@ sub usage {
 
 
 my $ignore_bd_arch = 0;
 my $ignore_bd_arch = 0;
 my $ignore_bd_indep = 0;
 my $ignore_bd_indep = 0;
+my $ignore_bd_builtin = 0;
 my ($bd_value, $bc_value);
 my ($bd_value, $bc_value);
 my $bp_value;
 my $bp_value;
 my $host_arch = get_host_arch();
 my $host_arch = get_host_arch();
@@ -73,6 +75,7 @@ my @options_spec = (
     'version' => sub { version(); exit 0; },
     'version' => sub { version(); exit 0; },
     'A' => \$ignore_bd_arch,
     'A' => \$ignore_bd_arch,
     'B' => \$ignore_bd_indep,
     'B' => \$ignore_bd_indep,
+    'I' => \$ignore_bd_builtin,
     'd=s' => \$bd_value,
     'd=s' => \$bd_value,
     'c=s' => \$bc_value,
     'c=s' => \$bc_value,
     'a=s' => \$host_arch,
     'a=s' => \$host_arch,
@@ -98,14 +101,16 @@ my $facts = parse_status("$admindir/status");
 
 
 unless (defined($bd_value) or defined($bc_value)) {
 unless (defined($bd_value) or defined($bc_value)) {
     my @bd_list;
     my @bd_list;
-    push @bd_list, run_vendor_hook('builtin-build-depends');
+    push @bd_list, run_vendor_hook('builtin-build-depends')
+        if not $ignore_bd_builtin;
     push @bd_list, $fields->{'Build-Depends'};
     push @bd_list, $fields->{'Build-Depends'};
     push @bd_list, $fields->{'Build-Depends-Arch'} if not $ignore_bd_arch;
     push @bd_list, $fields->{'Build-Depends-Arch'} if not $ignore_bd_arch;
     push @bd_list, $fields->{'Build-Depends-Indep'} if not $ignore_bd_indep;
     push @bd_list, $fields->{'Build-Depends-Indep'} if not $ignore_bd_indep;
     $bd_value = deps_concat(@bd_list);
     $bd_value = deps_concat(@bd_list);
 
 
     my @bc_list;
     my @bc_list;
-    push @bc_list, run_vendor_hook('builtin-build-conflicts');
+    push @bc_list, run_vendor_hook('builtin-build-conflicts')
+        if not $ignore_bd_builtin;
     push @bc_list, $fields->{'Build-Conflicts'};
     push @bc_list, $fields->{'Build-Conflicts'};
     push @bc_list, $fields->{'Build-Conflicts-Arch'} if not $ignore_bd_arch;
     push @bc_list, $fields->{'Build-Conflicts-Arch'} if not $ignore_bd_arch;
     push @bc_list, $fields->{'Build-Conflicts-Indep'} if not $ignore_bd_indep;
     push @bc_list, $fields->{'Build-Conflicts-Indep'} if not $ignore_bd_indep;