From: Guillem Jover Date: Sat, 12 May 2007 16:46:33 +0000 (+0000) Subject: * scripts/controllib.pl (debian_arch_eq): Rename to ... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23878c754e02b8f3042d1f52d76dc8d541141e9f;p=dpkg * 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. --- diff --git a/ChangeLog b/ChangeLog index 4776d38c..b614d2c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-11 Guillem Jover + + * 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 * scripts/update-alternatives.pl ($manual): Rename to ... diff --git a/scripts/controllib.pl b/scripts/controllib.pl index 6fab6ca0..66c54228 100755 --- a/scripts/controllib.pl +++ b/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; } diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index f9904848..9b89a2f7 100755 --- a/scripts/dpkg-architecture.pl +++ b/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; diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 1f254d30..ddf230cc 100755 --- a/scripts/dpkg-genchanges.pl +++ b/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)); diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 23fca04a..332d6553 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/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")); diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 1f345606..0d36f52b 100755 --- a/scripts/dpkg-source.pl +++ b/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 {