]> err.no Git - dpkg/commitdiff
dpkg-checkbuilddeps: add -d and -c options to override build-depends/conflicts
authorRaphael Hertzog <hertzog@debian.org>
Sat, 19 Jan 2008 21:55:01 +0000 (22:55 +0100)
committerRaphael Hertzog <hertzog@debian.org>
Thu, 24 Jan 2008 22:12:48 +0000 (23:12 +0100)
* scripts/dpkg-checkbuilddeps.pl: Add support of options -d and -c to use
build dependencies/conflicts given on the command line instead of those
retrieved from debian/control.
* man/dpkg-checkbuilddeps.1: Document the new options.

ChangeLog
debian/changelog
man/dpkg-checkbuilddeps.1
scripts/dpkg-checkbuilddeps.pl

index 3f8ace66e83051101512bbe2fc1e161d4753c44c..69c26cc7fd825d3463d455167641e3476d5f2ad4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
        * scripts/dpkg-genchanges.pl: Warn if the current version is
        smaller than the previous one.
 
+       * scripts/dpkg-checkbuilddeps.pl: Add support of options -d and -c to use
+       build dependencies/conflicts given on the command line instead of those
+       retrieved from debian/control.
+       * man/dpkg-checkbuilddeps.1: Document the new options.
+
 2008-01-22  Guillem Jover  <guillem@debian.org>
 
        * dpkg-deb/extract.c (extracthalf): Refactor fflush and its buggy
index b6359faa3b66985e9f50f39e8b62d84f9f87f18b..d554e2f58baf644eb4f65b5f92640056da07a275 100644 (file)
@@ -10,6 +10,8 @@ dpkg (1.14.17) UNRELEASED; urgency=low
   [ Raphael Hertzog ]
   * Add a warning displayed by dpkg-genchanges if the current version is
     smaller than the previous one. Closes: #4655
+  * Add -d and -c options in dpkg-checkbuilddeps to override
+    build-depends/conflicts. Closes: #114774
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
index 2214cedcc541e80483e30cc8d3662b13400a2367..96c7585794368571c686cf447be13ed4ef9f4837 100644 (file)
@@ -25,6 +25,12 @@ Change the location of the \fBdpkg\fR database. The default location is
 Ignore \fIBuild\-Depends\-Indep\fR lines. Use when no arch-indep packages will
 be built.
 .TP
+.BI "\-d " build-depends-string
+.TP
+.BI "\-c " build-conflicts-string
+Use the given build dependencies/conflicts instead of those contained in the
+debian/control file.
+.TP
 .B \-h
 Show the usage message and exit.
 .
index 49338e40f0c189a393655bc5d88d84b2f3cb9e82..e36919fbee19f5d8bb818413263b00843567d94e 100755 (executable)
@@ -21,6 +21,10 @@ sub usage {
 Options:
   control-file   control file to process (default: debian/control).
   -B             binary-only, ignore -Indep.
+  -d build-deps  use given string as build dependencies instead of
+                 retrieving them from control file
+  -c build-conf  use given string for build conflicts instead of
+                 retrieving them from control file
   --admindir=<directory>
                  change the administrative directory.
   -h             show this help message.
@@ -29,8 +33,11 @@ Options:
 
 my $binary_only=0;
 my $want_help=0;
+my ($bd_value, $bc_value);
 if (! GetOptions('-B' => \$binary_only,
                 '-h' => \$want_help,
+                '-d=s' => \$bd_value,
+                '-c=s' => \$bc_value,
                 '--admindir=s' => \$admindir)) {
        usage();
        exit(2);
@@ -46,30 +53,31 @@ my $control = Dpkg::Control->new($controlfile);
 my $fields = $control->get_source();
 
 my $facts = parse_status("$admindir/status");
-my (@unmet, @conflicts);
-
-push @unmet, build_depends('Implicit-Build-Depends',
-                           Dpkg::Deps::parse('build-essential'), $facts);
 
-if (defined($fields->{"Build-Depends"})) {
-       push @unmet, build_depends('Build-Depends',
-                                   Dpkg::Deps::parse($fields->{"Build-Depends"},
-                                        reduce_arch => 1), $facts);
-}
-if (defined($fields->{"Build-Conflicts"})) {
-       push @conflicts, build_conflicts('Build-Conflicts',
-                                         Dpkg::Deps::parse($fields->{"Build-Conflicts"},
-                                            reduce_arch => 1, union => 1), $facts);
+unless (defined($bd_value) or defined($bc_value)) {
+    $bd_value = 'build-essential';
+    $bd_value .= ", " . $fields->{"Build-Depends"} if defined $fields->{"Build-Depends"};
+    if (not $binary_only and defined $fields->{"Build-Depends-Indep"}) {
+       $bd_value .= ", " . $fields->{"Build-Depends-Indep"};
+    }
+    $bc_value = $fields->{"Build-Conflicts"} if defined $fields->{"Build-Conflicts"};
+    if (not $binary_only and defined $fields->{"Build-Conflicts-Indep"}) {
+       if ($bc_value) {
+           $bc_value .= ", " . $fields->{"Build-Conflicts-Indep"};
+       } else {
+           $bc_value = $fields->{"Build-Conflicts-Indep"};
+       }
+    }
 }
-if (! $binary_only && defined($fields->{"Build-Depends-Indep"})) {
-       push @unmet, build_depends('Build-Depends-Indep',
-                                   Dpkg::Deps::parse($fields->{"Build-Depends-Indep"},
-                                        reduce_arch => 1), $facts);
+my (@unmet, @conflicts);
+
+if ($bd_value) {
+       push @unmet, build_depends('Build-Depends/Build-Depends-Indep)',
+               Dpkg::Deps::parse($bd_value, reduce_arch => 1), $facts);
 }
-if (! $binary_only && defined($fields->{"Build-Conflicts-Indep"})) {
-       push @conflicts, build_conflicts('Build-Conflicts-Indep',
-                                         Dpkg::Deps::parse($fields->{"Build-Conflicts-Indep"},
-                                            reduce_arch => 1, union => 1), $facts);
+if ($bc_value) {
+       push @conflicts, build_conflicts('Build-Conflicts/Build-Conflicts-Indep',
+               Dpkg::Deps::parse($bc_value, reduce_arch => 1, union => 1), $facts);
 }
 
 if (@unmet) {