]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1924: * Patch from Guillem Jover to make --same-arch handling code support
authorjoeyh <joeyh>
Wed, 7 Jun 2006 17:59:20 +0000 (17:59 +0000)
committerjoeyh <joeyh>
Wed, 7 Jun 2006 17:59:20 +0000 (17:59 +0000)
  the new form of architecture wildcarding which allows use of things
  like "linux-any" and "any-i386" in the Architecture field. Note that
  you'll need to build-depend on a new enough dpkg-dev if using this
  support. Closes: #371082

Debian/Debhelper/Dh_Lib.pm
debian/changelog

index 793a2e0700894784ae147bab8f0ffb5ac911af3f..8b59d43aa579ffd1cff8f6043f7205ab9718ba1c 100644 (file)
@@ -559,6 +559,18 @@ sub excludefile {
        }
 }
 
+# Passed an arch and a list of arches to match against, returns true if matched
+sub samearch {
+       my $arch=shift;
+       my @archlist=split(/\s+/,shift);
+
+       foreach my $a (@archlist) {
+               system("dpkg-architecture", "-a$arch", "-i$a") == 0 && return 1;
+       }
+
+       return 0;
+}
+
 # Returns a list of packages in the control file.
 # Must pass "arch" or "indep" or "same" to specify arch-dependant or
 # -independant or same arch packages. If nothing is specified, returns all
@@ -616,7 +628,7 @@ sub getpackages {
                        if ($package &&
                            (($type eq 'indep' && $arch eq 'all') ||
                             ($type eq 'arch' && $arch ne 'all') ||
-                            ($type eq 'same' && ($arch eq 'any' || $arch =~ /(^|\s)$buildarch(\s|$)/)) ||
+                            ($type eq 'same' && ($arch eq 'any' || samearch($buildarch, $arch) ||
                             ! $type)) {
                                push @list, $package;
                                $package="";
index 163be0303db7bd651a607b25d8fb75ae3764fc11..211d8c0390a8a0c718d8d2973dfa23c53ed4a2f6 100644 (file)
@@ -5,8 +5,13 @@ debhelper (5.0.36) UNRELEASED; urgency=low
 
   [ Joey Hess ]
   * Remove old alternate dependency on fileutils. Closes: #370011
+  * Patch from Guillem Jover to make --same-arch handling code support
+    the new form of architecture wildcarding which allows use of things
+    like "linux-any" and "any-i386" in the Architecture field. Note that
+    you'll need to build-depend on a new enough dpkg-dev if using this
+    support. Closes: #371082
 
- -- Joey Hess <joeyh@debian.org>  Sat,  3 Jun 2006 17:00:06 -0400
+ -- Joey Hess <joeyh@debian.org>  Wed,  7 Jun 2006 13:57:38 -0400
 
 debhelper (5.0.35) unstable; urgency=low