On 10/08/11 14:00, Jonas Smedegaard wrote:
> On 11-08-10 at 10:37am, Emilio Pozuelo Monfort wrote:
>> On 10/08/11 08:24, Nobuhiro Iwamatsu wrote:
>>> cdbs does not support linux-any target yet.
>>> I made patch to support linux-any target. Could you apply this 
>>> patch?
>>>
>>> I tested some package with this patch. Work fine.
>>
>> This patch looks wrong. It won't work on !linux-any, e.g. kFreeBSD.
>>
>> The right way would be to test it with `dpkg-architecture -i$wildcard` 
>> and check if $? == 0.
> 
> Ah.  Thanks.
> 
> Sounds like you are more into these details than me.  I suspect that 
> perhaps there are limits on which releases of Debian works with above, 
> and also that when it works it might replace parts of the existing 
> script rather than only extending.
> 
> So would you perhaps be able to provide a patch?

How about this? (untested)

Emilio
>From 8ada9ba6f8f5ed62588c30b201d9c09e67845663 Mon Sep 17 00:00:00 2001
From: Emilio Pozuelo Monfort <[email protected]>
Date: Sat, 13 Aug 2011 13:43:33 +0100
Subject: [PATCH] list-packages: properly parse architecture wildcards

---
 scripts/list-packages |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/scripts/list-packages b/scripts/list-packages
index 4b985dc..3642a68 100755
--- a/scripts/list-packages
+++ b/scripts/list-packages
@@ -63,7 +63,10 @@ sub GetPackages {
 			if ($package &&
 			    (($type eq 'indep' && $arch eq 'all') ||
 			     ($type eq 'arch' && $arch ne 'all') ||
-			     ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) ||
+			     ($type eq 'same' && (
+				$arch eq 'any' ||
+				$arch =~ /\b$buildarch\b/ ||
+				system ("dpkg-architecture -a$buildarch -i$arch") == 0)) ||
 			     ! $type)) {
 				push @list, $package;
 				$package="";
-- 
1.7.5.4

Reply via email to