Hi,

On Tue, 2007-09-25 at 01:05:47 +0200, Frank Lichtenheld wrote:
> On Sat, Jun 02, 2007 at 01:43:21PM +0200, Bernhard R. Link wrote:
> > dpkg-gencontol does:
> > 
> > grep(debarch_is($host_arch, $_), @archlist) ||
> > &error(sprintf(_g("current build architecture %s does not".
> >                             " appear in package's list (%s)"),
> >                         $host_arch, "@archlist"));
> > 
> > which in current unstable results in a confusing error message like:
> > dpkg-gencontrol: error: current build architecture abacus does not appear 
> > in package's list (abacus)
> 
> I suggest this patch to fix the issue:
> 
> >From 16a119732007d5922f383a144c0d9137008aeedd Mon Sep 17 00:00:00 2001
> From: Frank Lichtenheld <[EMAIL PROTECTED]>
> Date: Tue, 25 Sep 2007 01:01:30 +0200
> Subject: [PATCH] controllib.pl: debarch_is(foo, 'any') should always be true
> 
> Currently this will not return true if foo has no defined
> triplet.
> 
> Signed-off-by: Frank Lichtenheld <[EMAIL PROTECTED]>
> ---
>  scripts/controllib.pl |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/controllib.pl b/scripts/controllib.pl
> index 1b7c52d..d5d1716 100755
> --- a/scripts/controllib.pl
> +++ b/scripts/controllib.pl
> @@ -299,6 +299,9 @@ sub debarch_eq($$)
>  sub debarch_is($$)
>  {
>      my ($real, $alias) = @_;
> +
> +    return 1 if $alias eq 'any';
> +
>      my @real = debarch_to_debtriplet($real);
>      my @alias = debwildcard_to_debtriplet($alias);

I don't think this fixes the problem, as the host arch would be 'abacus'
and the one listed in the Architecture field as well. Something like
this should:

diff --git a/scripts/controllib.pl b/scripts/controllib.pl
index 1b7c52d..e7ef8ab 100755
--- a/scripts/controllib.pl
+++ b/scripts/controllib.pl
@@ -249,10 +249,7 @@ sub debarch_to_debtriplet($)
     local ($_) = @_;
     my $arch;
 
-    # FIXME: 'any' is handled here, to be able to do debarch_eq('any', foo).
-    if (/^any$/ || /^all$/) {
-       return ($_, $_, $_);
-    } elsif (/^linux-([^-]*)/) {
+    if (/^linux-([^-]*)/) {
        # XXX: Might disappear in the future, not sure yet.
        $arch = $1;
     } else {
@@ -288,6 +285,9 @@ sub debwildcard_to_debtriplet($)
 sub debarch_eq($$)
 {
     my ($a, $b) = @_;
+
+    return 1 if ($a eq $b);
+
     my @a = debarch_to_debtriplet($a);
     my @b = debarch_to_debtriplet($b);
 
@@ -299,6 +299,9 @@ sub debarch_eq($$)
 sub debarch_is($$)
 {
     my ($real, $alias) = @_;
+
+    return 1 if ($alias eq $real or $alias eq 'any');
+
     my @real = debarch_to_debtriplet($real);
     my @alias = debwildcard_to_debtriplet($alias);
 

At the time of writting those functions, I made them more strict, and
not allowing unknown architectures was on purpose. But I suppose I
don't have such a strong position on this, and could just apply this
patch... what do you think, Frank?

regards,
guillem



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

Reply via email to