From 6f38a08d7cfbb6357597acece2dff4f594ba5222 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 24 May 2007 16:22:43 +0000 Subject: [PATCH] Recognize again architecture wildcards. Closes: #424670 --- ChangeLog | 9 +++++++++ debian/changelog | 1 + scripts/controllib.pl | 38 ++++++++++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbbf5dab..4edc8cbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-05-24 Guillem Jover + + * scripts/controllib.pl (debarch_to_debtriplet): Match exactly 'any' + or 'all', recognize again 'linux-', and do not accept unknown + debtriplets. + (debwildcard_to_debtriplet): New function. + (debarch_is): Use debwildcard_to_debtriplet for the wildcard + parameter. + 2007-05-23 Guillem Jover Revert commit on 2007-04-28 by Aaron M. Ucko . diff --git a/debian/changelog b/debian/changelog index f93261ac..7cc2aee0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ dpkg (1.14.4) UNRELEASED; urgency=low Thanks to Kylan Robinson. Closes: #425629 * Revert change on 1.14.0 from Aaron M. Ucko. Trim down duped entries only when passing them to dpkg-query instead. Closes: #425641 + * Recognize again architecture wildcards. Closes: #424670 [ Updated dpkg translations ] * French (Frédéric Bothamy). diff --git a/scripts/controllib.pl b/scripts/controllib.pl index e3c7ad00..9cf03826 100755 --- a/scripts/controllib.pl +++ b/scripts/controllib.pl @@ -255,19 +255,41 @@ sub debarch_to_debtriplet($) read_triplettable() if (!%debarch_to_debtriplet); local ($_) = @_; + my $arch; - if (/any/ || /all/) { + # FIXME: 'any' is handled here, to be able to do debarch_eq('any', foo). + if (/^any$/ || /^all$/) { return ($_, $_, $_); - } elsif (/^([^-]*)-([^-]*)-(.*)/) { - return ($1, $2, $3); + } elsif (/^linux-([^-]*)/) { + # XXX: Might disappear in the future, not sure yet. + $arch = $1; } else { - my $triplet = $debarch_to_debtriplet{$_}; + $arch = $_; + } + + my $triplet = $debarch_to_debtriplet{$arch}; - if (defined($triplet)) { - return split('-', $triplet, 3); + if (defined($triplet)) { + return split('-', $triplet, 3); + } else { + return undef; + } +} + +sub debwildcard_to_debtriplet($) +{ + local ($_) = @_; + + if (/any/) { + if (/^([^-]*)-([^-]*)-(.*)/) { + return ($1, $2, $3); + } elsif (/^([^-]*)-([^-]*)$/) { + return ('any', $1, $2); } else { - return undef; + return ($_, $_, $_); } + } else { + return debarch_to_debtriplet($_); } } @@ -286,7 +308,7 @@ sub debarch_is($$) { my ($real, $alias) = @_; my @real = debarch_to_debtriplet($real); - my @alias = debarch_to_debtriplet($alias); + my @alias = debwildcard_to_debtriplet($alias); return 0 if grep(!defined, (@real, @alias)); -- 2.39.5