(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/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 ...
}
}
-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);
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);
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
# is also listed..
$seen_arch=1;
}
- } elsif (debian_arch_is($host_arch, $arch)) {
+ } elsif (debarch_is($host_arch, $arch)) {
$seen_arch=1;
next;
}
} 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;
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;
}
$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 {
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));
} 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);
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"));
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"));
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 {