The following commit has been merged in the master branch:
commit c4f30d090995dda3ec301d4fc40fb7c87460f36a
Author: Colin Watson <[email protected]>
Date:   Tue Nov 22 09:17:36 2011 +0100

    dpkg-checkbuilddeps: new option -a <arch>
    
    This option tells dpkg-checkbuilddeps to check the build-dependencies
    assuming that they must all be satisfied on the given architecture.
    In the future build-dependencies might be annotated to indicate whether
    we need a package for the host or for the build architecture, but for
    now this is a first step that can already be useful.
    
    The normal Multi-Arch logic applies so that so that packages marked as
    "Multi-Arch: foreign" can satisfy a build-dependency no matter what
    architecture is requested. For the other packages, dpkg-checkbuilddeps
    will require a package from the requested architecture.
    
    Signed-off-by: Raphaël Hertzog <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index 373c6e2..5f40f17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,10 @@ dpkg (1.16.2) UNRELEASED; urgency=low
   * Update dpkg-gensymbols(1) to clarify that -e accepts shell patterns
     expansions and not regular expressions. And let dpkg-gensymbols output a
     warning when a pattern doesn't match any file. Closes: #649248
+  * Add new option "-a <arch>" to dpkg-checkbuilddeps to check build
+    dependencies for another architecture. This is really basic for now since
+    it assumes all build dependencies must be satisfied on the listed
+    architecture. Closes: #648180 Thanks to Colin Watson for the patch.
 
   [ Jonathan Nieder ]
   * Bump po4a version in Build-Depends to 0.41, since earlier versions do
diff --git a/man/dpkg-checkbuilddeps.1 b/man/dpkg-checkbuilddeps.1
index 807bf40..a08ae8c 100644
--- a/man/dpkg-checkbuilddeps.1
+++ b/man/dpkg-checkbuilddeps.1
@@ -31,6 +31,11 @@ be built.
 Use the given build dependencies/conflicts instead of those contained in the
 \fIdebian/control\fP file.
 .TP
+.BI "\-a " arch
+Check build dependencies/conflicts assuming that the package described in
+the control file is to be built for the given host architecture instead of
+the architecture of the current system.
+.TP
 .BR \-h ", " \-\-help
 Show the usage message and exit.
 .TP
diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl
index 93af92e..b757069 100755
--- a/scripts/dpkg-checkbuilddeps.pl
+++ b/scripts/dpkg-checkbuilddeps.pl
@@ -47,6 +47,7 @@ sub usage {
                  retrieving them from control file
   -c build-conf  use given string for build conflicts instead of
                  retrieving them from control file
+  -a arch        assume given host architecture
   --admindir=<directory>
                  change the administrative directory.
   -h, --help     show this help message.
@@ -58,11 +59,13 @@ sub usage {
 
 my $binary_only=0;
 my ($bd_value, $bc_value);
+my $host_arch = get_host_arch();
 if (!GetOptions('B' => \$binary_only,
                 'help|h' => sub { usage(); exit(0); },
                 'version' => \&version,
                 'd=s' => \$bd_value,
                 'c=s' => \$bc_value,
+                'a=s' => \$host_arch,
                 'admindir=s' => \$admindir)) {
        usage();
        exit(2);
@@ -94,11 +97,13 @@ my (@unmet, @conflicts);
 
 if ($bd_value) {
        push @unmet, build_depends('Build-Depends/Build-Depends-Indep)',
-               deps_parse($bd_value, reduce_arch => 1), $facts);
+               deps_parse($bd_value, host_arch => $host_arch,
+                          reduce_arch => 1), $facts);
 }
 if ($bc_value) {
        push @conflicts, 
build_conflicts('Build-Conflicts/Build-Conflicts-Indep',
-               deps_parse($bc_value, reduce_arch => 1, union => 1), $facts);
+               deps_parse($bc_value, host_arch => $host_arch,
+                          reduce_arch => 1, union => 1), $facts);
 }
 
 if (@unmet) {
@@ -178,8 +183,6 @@ sub check_line {
        my $fieldname=shift;
        my $dep_list=shift;
        my $facts=shift;
-       my $host_arch = shift || get_host_arch();
-       chomp $host_arch;
 
        my @unmet=();
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to