Browse Source

* scripts/controllib.pl (read_cputable): Localize $_.
(read_ostable): Likewise.
(read_triplettable): Likewise.
(parsedep): Check first for the negated architectures.
* scripts/dpkg-checkbuilddeps.pl: Do not enable slurp mode globally.
Use get_host_arch instead of directly dpkg-architecture.

Guillem Jover 17 years ago
parent
commit
16306a9cd7
3 changed files with 23 additions and 7 deletions
  1. 9 0
      ChangeLog
  2. 13 5
      scripts/controllib.pl
  3. 1 2
      scripts/dpkg-checkbuilddeps.pl

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2007-05-08  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (read_cputable): Localize $_.
+	(read_ostable): Likewise.
+	(read_triplettable): Likewise.
+	(parsedep): Check first for the negated architectures.
+	* scripts/dpkg-checkbuilddeps.pl: Do not enable slurp mode globally.
+	Use get_host_arch instead of directly dpkg-architecture.
+
 2007-05-08  Guillem Jover  <guillem@debian.org>
 
 	* scripts/dpkg-genchanges.pl ($pkgdatadir): New variable.

+ 13 - 5
scripts/controllib.pl

@@ -133,6 +133,8 @@ sub get_valid_arches()
 
 sub read_cputable
 {
+    local $_;
+
     open CPUTABLE, "$pkgdatadir/cputable"
 	or syserr(_g("unable to open cputable"));
     while (<CPUTABLE>) {
@@ -147,6 +149,8 @@ sub read_cputable
 
 sub read_ostable
 {
+    local $_;
+
     open OSTABLE, "$pkgdatadir/ostable"
 	or syserr(_g("unable to open ostable"));
     while (<OSTABLE>) {
@@ -163,6 +167,8 @@ sub read_triplettable()
 {
     read_cputable() if (!@cpu);
 
+    local $_;
+
     open TRIPLETTABLE, "$pkgdatadir/triplettable"
 	or syserr(_g("unable to open triplettable"));
     while (<TRIPLETTABLE>) {
@@ -438,10 +444,8 @@ ALTERNATE:
                 my $seen_arch='';
                 foreach my $arch (@arches) {
                     $arch=lc($arch);
-                    if (debian_arch_is($host_arch, $arch)) {
-                        $seen_arch=1;
-                        next;
-                    } elsif ($arch =~ /^!/) {
+
+		    if ($arch =~ /^!/) {
 			my $not_arch;
 			($not_arch = $arch) =~ s/^!//;
 
@@ -454,7 +458,11 @@ ALTERNATE:
 			    # is also listed..
 			    $seen_arch=1;
 			}
-                    }
+		    } elsif (debian_arch_is($host_arch, $arch)) {
+			$seen_arch=1;
+			next;
+		    }
+
                 }
                 if (! $seen_arch) {
                     next;

+ 1 - 2
scripts/dpkg-checkbuilddeps.pl

@@ -51,7 +51,6 @@ parsecontrolfile($controlfile);
 
 my @status = parse_status("$admindir/status");
 my (@unmet, @conflicts);
-local $/='';
 
 my $dep_regex=qr/[ \t]*(([^\n]+|\n[ \t])*)\s/; # allow multi-line
 if (defined($fi{"C Build-Depends"})) {
@@ -147,7 +146,7 @@ sub check_line {
 	my $dep_list=shift;
 	my %version=%{shift()};
 	my %providers=%{shift()};
-	my $host_arch=shift || `dpkg-architecture -qDEB_HOST_ARCH`;
+	my $host_arch = shift || get_host_arch();
 	chomp $host_arch;
 
 	my @unmet=();