Re: [PATCH] Permit architecture qualifiers, and strip them for edos-debcheck
On Sat, Aug 17, 2013 at 02:49:45PM +0200, Andreas Barth wrote:
> * Colin Watson (cjwatson@debian.org) [130817 14:39]:
> > That seems wrong; foo:native should work too (it's meaningful for
> > cross-builders but a no-op for native builders).
> >
> > I'm not sure what you're trying to express here. Can you give me an
> > example of what $0 (I guess you meant $_[0]) would be? Note that
> > build-dependencies on a specific architecture, as opposed to :any or
> > :native or unqualified, are not permitted by the current multiarch
> > specifications.
>
> I want to enforce that people stick to the specification.
>
> Basically changing remove_archqual($pkgs) to remove_archqual($arch,
> $pkgs) and then filtering out the wrong ones (which should be empty
> but).
OK. But $arch makes no sense given that build-dependencies on a
specific architecture are not permitted, so the remove_archqual
signature can stay as it is.
> Adding more qualifiers like native are ok with me if that would
> work on our current buildds, but I want to protect our buildds from
> running jobs which won't work anyways.
As far as I know :native works fine; certainly my rebase against wheezy
of a set of sbuild patches that permitted it came out empty.
New version attached.
Thanks,
--
Colin Watson [cjwatson@debian.org]
>From 5311b9df1fc6c2bdc19f0b76b2df1362f579c058 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Sat, 17 Aug 2013 11:38:48 +0200
Subject: [PATCH] Permit architecture qualifiers, and strip them for
edos-debcheck
Architecture qualifiers (such as :any and :native) work fine with
current sbuild. However, edos-debcheck doesn't understand them, so
strip them off in the synthetic Packages files passed to edos-debcheck.
The worst case here should be that packages with "Build-Depends:
foo:any" may be scheduled for building and then fail if "foo" is not
"Multi-Arch: allowed"; this is not too bad, and it usually corresponds
to a maintainer error anyway.
---
bin/wanna-build | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/bin/wanna-build b/bin/wanna-build
index 5df0dc6..619b6b0 100755
--- a/bin/wanna-build
+++ b/bin/wanna-build
@@ -1635,10 +1635,27 @@ sub build_deplist {
}
+sub remove_archqual {
+ if ($_[0]->isa('Dpkg::Deps::Simple')) {
+ if (defined $_[0]->{'archqual'}) {
+ if (grep { $_ eq $_[0]->{'archqual'} } ('any', 'native')) {
+ undef $_[0]->{'archqual'};
+ } else {
+ return "invalid-architecture-qualifier-$_[0]->{'archqual'}";
+ }
+ }
+ } else {
+ for my $dep ($_[0]->get_deps()) {
+ remove_archqual($dep);
+ }
+ }
+}
+
sub filterarch {
return "" unless $_[0];
- return "not-existing-build-dependency-for-any" if $_[0] =~ /:any/;
- return Dpkg::Deps::deps_parse($_[0], ("reduce_arch" => 1, "host_arch" => $_[1]))->output();
+ my $deps = Dpkg::Deps::deps_parse($_[0], ("reduce_arch" => 1, "host_arch" => $_[1], "build_dep" => 1));
+ remove_archqual($deps);
+ return $deps->output();
}
sub wb_edos_builddebcheck {
--
1.8.3.2
Reply to: