Browse Source

* scripts/controllib.pl (debian_arch_eq): Rename to ...
(debarch_eq): ... this. Add prototype. Fix all callers.
(debian_arch_is): Rename to ...
(debarch_is): ... this. Add prototype. Fix all callers.

Guillem Jover 17 years ago
parent
commit
23878c754e

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2007-05-11  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (debian_arch_eq): Rename to ...
+	(debarch_eq): ... this. Add prototype. Fix all callers.
+	(debian_arch_is): Rename to ...
+	(debarch_is): ... this. Add prototype. Fix all callers.
+
 2007-05-11  Guillem Jover  <guillem@debian.org>
 
 	* scripts/update-alternatives.pl ($manual): Rename to ...

+ 6 - 4
scripts/controllib.pl

@@ -271,7 +271,8 @@ sub debarch_to_debtriplet($)
     }
 }
 
-sub debian_arch_eq {
+sub debarch_eq($$)
+{
     my ($a, $b) = @_;
     my ($a_abi, $a_os, $a_cpu) = debarch_to_debtriplet($a);
     my ($b_abi, $b_os, $b_cpu) = debarch_to_debtriplet($b);
@@ -279,7 +280,8 @@ sub debian_arch_eq {
     return ("$a_abi-$a_os-$a_cpu" eq "$b_abi-$b_os-$b_cpu");
 }
 
-sub debian_arch_is {
+sub debarch_is($$)
+{
     my ($real, $alias) = @_;
     my ($real_abi, $real_os, $real_cpu) = debarch_to_debtriplet($real);
     my ($alias_abi, $alias_os, $alias_cpu) = debarch_to_debtriplet($alias);
@@ -449,7 +451,7 @@ ALTERNATE:
 			my $not_arch;
 			($not_arch = $arch) =~ s/^!//;
 
-			if (debian_arch_is($host_arch, $not_arch)) {
+			if (debarch_is($host_arch, $not_arch)) {
 			    next ALTERNATE;
 			} else {
 			    # This is equivilant to
@@ -458,7 +460,7 @@ ALTERNATE:
 			    # is also listed..
 			    $seen_arch=1;
 			}
-		    } elsif (debian_arch_is($host_arch, $arch)) {
+		    } elsif (debarch_is($host_arch, $arch)) {
 			$seen_arch=1;
 			next;
 		    }

+ 2 - 2
scripts/dpkg-architecture.pl

@@ -234,9 +234,9 @@ if ($action eq 'l') {
 } elsif ($action eq 'u') {
     print "unset ".join(" ",@ordered)."\n";
 } elsif ($action eq 'e') {
-    exit !debian_arch_eq($deb_host_arch, $req_eq_arch);
+    exit !debarch_eq($deb_host_arch, $req_eq_arch);
 } elsif ($action eq 'i') {
-    exit !debian_arch_is($deb_host_arch, $req_is_arch);
+    exit !debarch_is($deb_host_arch, $req_is_arch);
 } elsif ($action eq 'c') {
     @ENV{keys %env} = values %env;
     exec @ARGV;

+ 7 - 7
scripts/dpkg-genchanges.pl

@@ -221,9 +221,9 @@ for $_ (keys %fi) {
 	my $host_arch = get_host_arch();
 
 	if (!defined($p2f{$p}) && not $sourceonly) {
-	    if ((debian_arch_eq('all', $a) && !$archspecific) ||
-		debian_arch_is($host_arch, $a) ||
-		grep(debian_arch_is($host_arch, $_), split(/\s+/, $a))) {
+	    if ((debarch_eq('all', $a) && !$archspecific) ||
+		debarch_is($host_arch, $a) ||
+		grep(debarch_is($host_arch, $_), split(/\s+/, $a))) {
 		warning(sprintf(_g("package %s in control file but not in files list"), $p));
 		next;
 	    }
@@ -246,10 +246,10 @@ for $_ (keys %fi) {
 		$f{$_}= $v;
 	    } elsif (m/^Architecture$/) {
 		if (not $sourceonly) {
-		    if (debian_arch_is($host_arch, $v) ||
-		        grep(debian_arch_is($host_arch, $_), split(/\s+/, $v))) {
+		    if (debarch_is($host_arch, $v) ||
+		        grep(debarch_is($host_arch, $_), split(/\s+/, $v))) {
 			$v = $host_arch;
-		    } elsif (!debian_arch_eq('all', $v)) {
+		    } elsif (!debarch_eq('all', $v)) {
 			$v= '';
 		    }
 		} else {
@@ -396,7 +396,7 @@ $f{'Files'}= '';
 my %filedone;
 
 for my $f (@sourcefiles, @fileslistfiles) {
-    next if ($archspecific && debian_arch_eq('all', $p2arch{$f2p{$f}}));
+    next if ($archspecific && debarch_eq('all', $p2arch{$f2p{$f}}));
     next if $filedone{$f}++;
     my $uf = "$uploadfilesdir/$f";
     open(STDIN,"< $uf") || &syserr(sprintf(_g("cannot open upload file %s for reading"), $uf));

+ 5 - 5
scripts/dpkg-gencontrol.pl

@@ -169,9 +169,9 @@ for $_ (keys %fi) {
         } elsif (m/^Architecture$/) {
 	    my $host_arch = get_host_arch();
 
-            if (debian_arch_eq('all', $v)) {
+            if (debarch_eq('all', $v)) {
                 $f{$_}= $v;
-	    } elsif (debian_arch_is($host_arch, $v)) {
+	    } elsif (debarch_is($host_arch, $v)) {
 		$f{$_} = $host_arch;
             } else {
 		my @archlist = split(/\s+/, $v);
@@ -182,7 +182,7 @@ for $_ (keys %fi) {
 		                  scalar(@invalid_archs)),
 		              join("' `", @invalid_archs)))
 		    if @invalid_archs >= 1;
-		grep(debian_arch_is($host_arch, $_), @archlist) ||
+		grep(debarch_is($host_arch, $_), @archlist) ||
                     &error(sprintf(_g("current build architecture %s does not".
                                       " appear in package's list (%s)"),
 		                   $host_arch, "@archlist"));
@@ -301,8 +301,8 @@ if (open(X,"< $fileslistfile")) {
         chomp;
         next if m/^([-+0-9a-z.]+)_[^_]+_([\w-]+)\.deb /
                 && ($1 eq $oppackage)
-                && (debian_arch_eq($2, $f{'Architecture'})
-		    || debian_arch_eq($2, 'all'));
+	        && (debarch_eq($2, $f{'Architecture'})
+		    || debarch_eq($2, 'all'));
         print(Y "$_\n") || &syserr(_g("copy old entry to new files list file"));
     }
     close(X) || &syserr(_g("close old files list file"));

+ 2 - 2
scripts/dpkg-source.pl

@@ -255,9 +255,9 @@ if ($opmode eq 'build') {
 	    my $p = $fi{"C$i Package"};
             push(@binarypackages,$p) unless $packageadded{$p}++;
             if (m/^Architecture$/) {
-                if (debian_arch_eq($v, 'any')) {
+		if (debarch_eq($v, 'any')) {
                     @sourcearch= ('any');
-                } elsif (debian_arch_eq($v, 'all')) {
+		} elsif (debarch_eq($v, 'all')) {
                     if (!@sourcearch || $sourcearch[0] eq 'all') {
                         @sourcearch= ('all');
                     } else {