On Wed, Nov 09, 2011 at 02:47:08PM +0100, Raphael Hertzog wrote:
> On Wed, 09 Nov 2011, Colin Watson wrote:
> > In a multiarch environment, it's useful to be able to check whether
> > build-dependencies are satisfied for a different architecture. It looks
> > rather easy to add an -a option to dpkg-checkbuilddeps, although it does
> > require translation changes. Would you consider something like this
> > patch?
>
> Yes, it looks sane even if it's only a partial solution since we do not
> support yet proper tagging of build-dependencies to know whether we need
> the package for the host or the build architecture (which also explains
> why dpkg-buildpackage doesn't call dpkg-checkbuilddeps when it's called
> with -a).
Right. In general I'm aware that this is getting ahead of ourselves a
little, but it seems harmless and is a small additional step. I did try
it out in some simple cases on a multiarch system (i.e. without the
involvement of :native or :any) and it did the right thing as far as I
could tell.
> Can you please include in your patch the manual page update corresponding
> to your change?
Oh, good point.
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=();
Thanks,
--
Colin Watson [[email protected]]
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]