From: Guillem Jover Date: Mon, 8 Oct 2007 03:00:38 +0000 (+0300) Subject: Allow comparing unsupported architectures for equality and identity X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6d086484cba5a0abbfc14f40ecbd0221e5ceb24;p=dpkg Allow comparing unsupported architectures for equality and identity --- diff --git a/ChangeLog b/ChangeLog index 19b3742e..028e2b67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-10-08 Frank Lichtenheld , + Guillem Jover + + * scripts/controllib.pl (debarch_is): Check if $alias is equal to + $real or 'any' before mapping them to debtriplets. + (debarch_to_debtriplet): Do not special case 'any' nor 'all'. + (debarch_eq): Check if $a and $b are equal before mapping them to + debtriplets. + 2007-10-07 Guillem Jover * scripts/dpkg-buildpackage.pl: Warn if run as root and $rootcommand diff --git a/debian/changelog b/debian/changelog index 139d1c02..6bf9eb7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ dpkg (1.14.7) UNRELEASED; urgency=low instead of unconditionally setting it to 'Installed'. Closes: #432893 Thanks to Brian M. Carlson. * Add Vcs-Browser and Vcs-Git fields to debian/control. + * Allow comparing unsupported architectures for equality and identity. + Based on a patch by Frank Lichtenheld. Closes: #427210 [ Frank Lichtenheld ] * Add _MTN to dpkg-source -i default regex. Suggested by Jari Aalto. diff --git a/scripts/controllib.pl b/scripts/controllib.pl index 1b7c52d9..e7ef8abd 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);