+2007-05-24 Guillem Jover <guillem@debian.org>
+
+ * scripts/controllib.pl (debarch_to_debtriplet): Match exactly 'any'
+ or 'all', recognize again 'linux-<arch>', 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 <guillem@debian.org>
Revert commit on 2007-04-28 by Aaron M. Ucko <ucko@debian.org>.
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).
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($_);
}
}
{
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));