+2007-11-04 Guillem Jover <guillem@debian.org>
+
+ * scripts/Dpkg/Arch.pm (debarch_to_gnutriplet): New function.
+ (gnutriplet_to_debarch): Likewise.
+ * scripts/dpkg-architecture.pl: Use debarch_to_gnutriplet and
+ gnutriplet_to_debarch instead of nested calls to
+ debtriplet_to_gnutriplet and debarch_to_debtriplet,
+ debtriplet_to_debarch and gnutriplet_to_debtriplet.
+
2007-11-04 Guillem Jover <guillem@debian.org>
* scripts/dpkg-architecture.pl: Move setting of host and build arch
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(get_host_arch get_valid_arches debarch_eq debarch_is
+ debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
debtriplet_to_debarch debarch_to_debtriplet);
}
}
+sub debarch_to_gnutriplet($)
+{
+ my ($arch) = @_;
+
+ return debtriplet_to_gnutriplet(debarch_to_debtriplet($arch));
+}
+
+sub gnutriplet_to_debarch($)
+{
+ my ($gnu) = @_;
+
+ return debtriplet_to_debarch(gnutriplet_to_debtriplet($gnu));
+}
+
sub debwildcard_to_debtriplet($)
{
local ($_) = @_;
use Dpkg::ErrorHandling qw(warning syserr usageerr);
use Dpkg::Arch qw(get_valid_arches debarch_eq debarch_is
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ debarch_to_gnutriplet gnutriplet_to_debarch);
textdomain("dpkg-dev");
chomp (my $deb_build_arch = `dpkg --print-architecture`);
&syserr("dpkg --print-architecture failed") if $?>>8;
-my $deb_build_gnu_type = debtriplet_to_gnutriplet(debarch_to_debtriplet($deb_build_arch));
+my $deb_build_gnu_type = debarch_to_gnutriplet($deb_build_arch);
# Default host: Current gcc.
my $gcc = `\${CC:-gcc} -dumpmachine`;
}
if ($req_host_arch ne '' && $req_host_gnu_type eq '') {
- $req_host_gnu_type = debtriplet_to_gnutriplet(debarch_to_debtriplet($req_host_arch));
+ $req_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
die (sprintf(_g("unknown Debian architecture %s, you must specify GNU system type, too"), $req_host_arch)) unless defined $req_host_gnu_type;
}
if ($req_host_gnu_type ne '' && $req_host_arch eq '') {
- $req_host_arch = debtriplet_to_debarch(gnutriplet_to_debtriplet($req_host_gnu_type));
+ $req_host_arch = gnutriplet_to_debarch($req_host_gnu_type);
die (sprintf(_g("unknown GNU system type %s, you must specify Debian architecture, too"), $req_host_gnu_type)) unless defined $req_host_arch;
}
if ($req_host_gnu_type ne '' && $req_host_arch ne '') {
- my $dfl_host_gnu_type = debtriplet_to_gnutriplet(debarch_to_debtriplet($req_host_arch));
+ my $dfl_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
die (sprintf(_g("unknown default GNU system type for Debian architecture %s"),
$req_host_arch))
unless defined $dfl_host_gnu_type;