Pārlūkot izejas kodu

Allow comparing unsupported architectures for equality and identity

Guillem Jover 19 gadi atpakaļ
vecāks
revīzija
f6d086484c
3 mainītis faili ar 18 papildinājumiem un 4 dzēšanām
  1. 9 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 7 4
      scripts/controllib.pl

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2007-10-08  Frank Lichtenheld  <djpig@debian.org>,
+            Guillem Jover  <guillem@debian.org>
+
+	* 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  <guillem@debian.org>
 
 	* scripts/dpkg-buildpackage.pl: Warn if run as root and $rootcommand

+ 2 - 0
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.

+ 7 - 4
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);