FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 03-08-2011, 09:32 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Add new variables that return the "ideal" GNU triplet for each architecture
which should be used as the path component for library installation.
---
debian/changelog | 5 +++
man/dpkg-architecture.1 | 6 ++++
scripts/Dpkg/Arch.pm | 66 +++++++++++++++++++++++++++++++++++++++++-
scripts/dpkg-architecture.pl | 10 +++++-
4 files changed, 84 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9f23d32..5cbb06f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,11 @@ dpkg (1.16.0) UNRELEASED; urgency=low
[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

+ [ Steve Langasek ]
+ * add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH, that
+ return the "ideal" GNU triplet for each architecture which should be
+ used as the path component for library installation.
+
-- Guillem Jover <guillem@debian.org> Thu, 29 Jul 2010 11:00:22 +0200

dpkg (1.15.8.10) unstable; urgency=low
diff --git a/man/dpkg-architecture.1 b/man/dpkg-architecture.1
index 4ca309e..3176d1b 100644
--- a/man/dpkg-architecture.1
+++ b/man/dpkg-architecture.1
@@ -115,6 +115,9 @@ The s-1CPUs0 part of s-1DEB_BUILD_GNU_TYPEs0.
The System part of s-1DEB_BUILD_GNU_TYPEs0.
.IP "s-1DEB_BUILD_GNU_TYPEs0" 4
The s-1GNUs0 system type of the build machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the build machine, used for filesystem
+paths.
.IP "s-1DEB_HOST_ARCHs0" 4
The Debian architecture of the host machine.
.IP "s-1DEB_HOST_ARCH_OSs0" 4
@@ -131,6 +134,9 @@ The s-1CPUs0 part of s-1DEB_HOST_GNU_TYPEs0.
The System part of s-1DEB_HOST_GNU_TYPEs0.
.IP "s-1DEB_HOST_GNU_TYPEs0" 4
The s-1GNUs0 system type of the host machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the host machine, used for filesystem
+paths.
.
.SH "DEBIAN/RULES"
The environment variables set by fBdpkg-architecturefP are passed to
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index da72345..20d7346 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -25,7 +25,9 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ gnutriplet_to_multiarch multiarch_to_gnutriplet
+ debarch_to_multiarch multiarch_to_debarch);

use Dpkg;
use Dpkg::Gettext;
@@ -39,6 +41,9 @@ my (%cpubits, %cpuendian);
my %debtriplet_to_debarch;
my %debarch_to_debtriplet;

+my %gnutriplet_to_matriplet;
+my %matriplet_to_gnutriplet;
+
{
my $build_arch;
my $host_arch;
@@ -195,6 +200,25 @@ sub read_triplettable()
close TRIPLETTABLE;
}

+sub read_multiarchtable()
+{
+ local $_;
+ local $/ = "
";
+
+ open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
+ or syserr(_g("cannot open %s"), "multiarchtable");
+ while (<MULTIARCHTABLE>) {
+ if (m/^(?!#)(S+)s+(S+)/) {
+ my $gnutriplet = $1;
+ my $matriplet = $2;
+
+ $matriplet_to_gnutriplet{$2} = $1;
+ $gnutriplet_to_matriplet{$1} = $2;
+ }
+ }
+ close MULTIARCHTABLE;
+}
+
sub debtriplet_to_gnutriplet(@)
{
read_cputable() if (!@cpu);
@@ -237,6 +261,46 @@ sub gnutriplet_to_debtriplet($)
return (split(/-/, $os, 2), $cpu);
}

+sub gnutriplet_to_multiarch($)
+{
+ read_multiarchtable() if (!%gnutriplet_to_matriplet);
+
+ my ($gnu) = @_;
+
+ if (exists $gnutriplet_to_matriplet{"$gnu"}) {
+ return $gnutriplet_to_matriplet{"$gnu"};
+ } else {
+ return $gnu;
+ }
+}
+
+sub multiarch_to_gnutriplet($)
+{
+ read_multiarchtable() if (!%matriplet_to_gnutriplet);
+
+ my ($multi) = @_;
+
+ if (exists $matriplet_to_gnutriplet{"$multi"}) {
+ return $matriplet_to_gnutriplet{"$multi"};
+ } else {
+ return $multi;
+ }
+}
+
+sub debarch_to_multiarch($)
+{
+ my ($arch) = @_;
+
+ return gnutriplet_to_multiarch(debarch_to_gnutriplet($arc h));
+}
+
+sub multiarch_to_debarch($)
+{
+ my ($ma) = @_;
+
+ return gnutriplet_to_debarch(multiarch_to_gnutriplet($ma) );
+}
+
sub debtriplet_to_debarch(@)
{
read_triplettable() if (!%debtriplet_to_debarch);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 40b680e..e030827 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::ErrorHandling;
use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
debarch_to_cpuattrs
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
- debarch_to_gnutriplet gnutriplet_to_debarch);
+ debarch_to_gnutriplet gnutriplet_to_debarch
+ debarch_to_multiarch);

textdomain("dpkg-dev");

@@ -127,9 +128,11 @@ my %v;
my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_MULTIARCH
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
- DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE
+ DEB_HOST_MULTIARCH);

$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
@@ -190,6 +193,9 @@ my $abi;
($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});

+$v{DEB_BUILD_MULTIARCH} = debarch_to_multiarch($v{DEB_BUILD_ARCH});
+$v{DEB_HOST_MULTIARCH} = debarch_to_multiarch($v{DEB_HOST_ARCH});
+
for my $k (@ordered) {
$v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
}
--
1.7.1


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1299623537-31622-1-git-send-email-steve.langasek@linaro.org">http://lists.debian.org/1299623537-31622-1-git-send-email-steve.langasek@linaro.org
 
Old 03-08-2011, 09:39 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Add new variables that return the "ideal" GNU triplet for each architecture
which should be used as the path component for library installation.
---
debian/changelog | 5 +++
man/dpkg-architecture.1 | 6 ++++
scripts/Dpkg/Arch.pm | 66 +++++++++++++++++++++++++++++++++++++++++-
scripts/dpkg-architecture.pl | 10 +++++-
4 files changed, 84 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9f23d32..5cbb06f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,11 @@ dpkg (1.16.0) UNRELEASED; urgency=low
[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

+ [ Steve Langasek ]
+ * add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH, that
+ return the "ideal" GNU triplet for each architecture which should be
+ used as the path component for library installation.
+
-- Guillem Jover <guillem@debian.org> Thu, 29 Jul 2010 11:00:22 +0200

dpkg (1.15.8.10) unstable; urgency=low
diff --git a/man/dpkg-architecture.1 b/man/dpkg-architecture.1
index 4ca309e..3176d1b 100644
--- a/man/dpkg-architecture.1
+++ b/man/dpkg-architecture.1
@@ -115,6 +115,9 @@ The s-1CPUs0 part of s-1DEB_BUILD_GNU_TYPEs0.
The System part of s-1DEB_BUILD_GNU_TYPEs0.
.IP "s-1DEB_BUILD_GNU_TYPEs0" 4
The s-1GNUs0 system type of the build machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the build machine, used for filesystem
+paths.
.IP "s-1DEB_HOST_ARCHs0" 4
The Debian architecture of the host machine.
.IP "s-1DEB_HOST_ARCH_OSs0" 4
@@ -131,6 +134,9 @@ The s-1CPUs0 part of s-1DEB_HOST_GNU_TYPEs0.
The System part of s-1DEB_HOST_GNU_TYPEs0.
.IP "s-1DEB_HOST_GNU_TYPEs0" 4
The s-1GNUs0 system type of the host machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the host machine, used for filesystem
+paths.
.
.SH "DEBIAN/RULES"
The environment variables set by fBdpkg-architecturefP are passed to
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index da72345..20d7346 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -25,7 +25,9 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ gnutriplet_to_multiarch multiarch_to_gnutriplet
+ debarch_to_multiarch multiarch_to_debarch);

use Dpkg;
use Dpkg::Gettext;
@@ -39,6 +41,9 @@ my (%cpubits, %cpuendian);
my %debtriplet_to_debarch;
my %debarch_to_debtriplet;

+my %gnutriplet_to_matriplet;
+my %matriplet_to_gnutriplet;
+
{
my $build_arch;
my $host_arch;
@@ -195,6 +200,25 @@ sub read_triplettable()
close TRIPLETTABLE;
}

+sub read_multiarchtable()
+{
+ local $_;
+ local $/ = "
";
+
+ open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
+ or syserr(_g("cannot open %s"), "multiarchtable");
+ while (<MULTIARCHTABLE>) {
+ if (m/^(?!#)(S+)s+(S+)/) {
+ my $gnutriplet = $1;
+ my $matriplet = $2;
+
+ $matriplet_to_gnutriplet{$2} = $1;
+ $gnutriplet_to_matriplet{$1} = $2;
+ }
+ }
+ close MULTIARCHTABLE;
+}
+
sub debtriplet_to_gnutriplet(@)
{
read_cputable() if (!@cpu);
@@ -237,6 +261,46 @@ sub gnutriplet_to_debtriplet($)
return (split(/-/, $os, 2), $cpu);
}

+sub gnutriplet_to_multiarch($)
+{
+ read_multiarchtable() if (!%gnutriplet_to_matriplet);
+
+ my ($gnu) = @_;
+
+ if (exists $gnutriplet_to_matriplet{"$gnu"}) {
+ return $gnutriplet_to_matriplet{"$gnu"};
+ } else {
+ return $gnu;
+ }
+}
+
+sub multiarch_to_gnutriplet($)
+{
+ read_multiarchtable() if (!%matriplet_to_gnutriplet);
+
+ my ($multi) = @_;
+
+ if (exists $matriplet_to_gnutriplet{"$multi"}) {
+ return $matriplet_to_gnutriplet{"$multi"};
+ } else {
+ return $multi;
+ }
+}
+
+sub debarch_to_multiarch($)
+{
+ my ($arch) = @_;
+
+ return gnutriplet_to_multiarch(debarch_to_gnutriplet($arc h));
+}
+
+sub multiarch_to_debarch($)
+{
+ my ($ma) = @_;
+
+ return gnutriplet_to_debarch(multiarch_to_gnutriplet($ma) );
+}
+
sub debtriplet_to_debarch(@)
{
read_triplettable() if (!%debtriplet_to_debarch);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 40b680e..e030827 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::ErrorHandling;
use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
debarch_to_cpuattrs
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
- debarch_to_gnutriplet gnutriplet_to_debarch);
+ debarch_to_gnutriplet gnutriplet_to_debarch
+ debarch_to_multiarch);

textdomain("dpkg-dev");

@@ -127,9 +128,11 @@ my %v;
my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_MULTIARCH
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
- DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE
+ DEB_HOST_MULTIARCH);

$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
@@ -190,6 +193,9 @@ my $abi;
($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});

+$v{DEB_BUILD_MULTIARCH} = debarch_to_multiarch($v{DEB_BUILD_ARCH});
+$v{DEB_HOST_MULTIARCH} = debarch_to_multiarch($v{DEB_HOST_ARCH});
+
for my $k (@ordered) {
$v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
}
--
1.7.1


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1299623984-31859-2-git-send-email-steve.langasek@linaro.org">http://lists.debian.org/1299623984-31859-2-git-send-email-steve.langasek@linaro.org
 
Old 03-08-2011, 09:53 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Add new variables that return the "ideal" GNU triplet for each architecture
which should be used as the path component for library installation.
---
Makefile.am | 2 +-
debian/changelog | 5 +++
man/dpkg-architecture.1 | 6 ++++
multiarchtable | 4 ++
scripts/Dpkg/Arch.pm | 66 +++++++++++++++++++++++++++++++++++++++++-
scripts/dpkg-architecture.pl | 10 +++++-
6 files changed, 89 insertions(+), 4 deletions(-)
create mode 100644 multiarchtable

diff --git a/Makefile.am b/Makefile.am
index f1561ef..2f4b55e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ SUBDIRS =
ACLOCAL_AMFLAGS = -I m4


-dist_pkgdata_DATA = cputable ostable triplettable
+dist_pkgdata_DATA = cputable ostable triplettable multiarchtable

EXTRA_DIST =
.mailmap
diff --git a/debian/changelog b/debian/changelog
index 9f23d32..5cbb06f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,11 @@ dpkg (1.16.0) UNRELEASED; urgency=low
[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

+ [ Steve Langasek ]
+ * add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH, that
+ return the "ideal" GNU triplet for each architecture which should be
+ used as the path component for library installation.
+
-- Guillem Jover <guillem@debian.org> Thu, 29 Jul 2010 11:00:22 +0200

dpkg (1.15.8.10) unstable; urgency=low
diff --git a/man/dpkg-architecture.1 b/man/dpkg-architecture.1
index 4ca309e..3176d1b 100644
--- a/man/dpkg-architecture.1
+++ b/man/dpkg-architecture.1
@@ -115,6 +115,9 @@ The s-1CPUs0 part of s-1DEB_BUILD_GNU_TYPEs0.
The System part of s-1DEB_BUILD_GNU_TYPEs0.
.IP "s-1DEB_BUILD_GNU_TYPEs0" 4
The s-1GNUs0 system type of the build machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the build machine, used for filesystem
+paths.
.IP "s-1DEB_HOST_ARCHs0" 4
The Debian architecture of the host machine.
.IP "s-1DEB_HOST_ARCH_OSs0" 4
@@ -131,6 +134,9 @@ The s-1CPUs0 part of s-1DEB_HOST_GNU_TYPEs0.
The System part of s-1DEB_HOST_GNU_TYPEs0.
.IP "s-1DEB_HOST_GNU_TYPEs0" 4
The s-1GNUs0 system type of the host machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the host machine, used for filesystem
+paths.
.
.SH "DEBIAN/RULES"
The environment variables set by fBdpkg-architecturefP are passed to
diff --git a/multiarchtable b/multiarchtable
new file mode 100644
index 0000000..031879b
--- /dev/null
+++ b/multiarchtable
@@ -0,0 +1,4 @@
+# Bidirectional mapping between a GNU triplet and a Multiarch triplet.
+#
+# <GNU triplet> <Multiarch triplet>
+i486-linux-gnu i386-linux-gnu
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index da72345..20d7346 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -25,7 +25,9 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ gnutriplet_to_multiarch multiarch_to_gnutriplet
+ debarch_to_multiarch multiarch_to_debarch);

use Dpkg;
use Dpkg::Gettext;
@@ -39,6 +41,9 @@ my (%cpubits, %cpuendian);
my %debtriplet_to_debarch;
my %debarch_to_debtriplet;

+my %gnutriplet_to_matriplet;
+my %matriplet_to_gnutriplet;
+
{
my $build_arch;
my $host_arch;
@@ -195,6 +200,25 @@ sub read_triplettable()
close TRIPLETTABLE;
}

+sub read_multiarchtable()
+{
+ local $_;
+ local $/ = "
";
+
+ open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
+ or syserr(_g("cannot open %s"), "multiarchtable");
+ while (<MULTIARCHTABLE>) {
+ if (m/^(?!#)(S+)s+(S+)/) {
+ my $gnutriplet = $1;
+ my $matriplet = $2;
+
+ $matriplet_to_gnutriplet{$2} = $1;
+ $gnutriplet_to_matriplet{$1} = $2;
+ }
+ }
+ close MULTIARCHTABLE;
+}
+
sub debtriplet_to_gnutriplet(@)
{
read_cputable() if (!@cpu);
@@ -237,6 +261,46 @@ sub gnutriplet_to_debtriplet($)
return (split(/-/, $os, 2), $cpu);
}

+sub gnutriplet_to_multiarch($)
+{
+ read_multiarchtable() if (!%gnutriplet_to_matriplet);
+
+ my ($gnu) = @_;
+
+ if (exists $gnutriplet_to_matriplet{"$gnu"}) {
+ return $gnutriplet_to_matriplet{"$gnu"};
+ } else {
+ return $gnu;
+ }
+}
+
+sub multiarch_to_gnutriplet($)
+{
+ read_multiarchtable() if (!%matriplet_to_gnutriplet);
+
+ my ($multi) = @_;
+
+ if (exists $matriplet_to_gnutriplet{"$multi"}) {
+ return $matriplet_to_gnutriplet{"$multi"};
+ } else {
+ return $multi;
+ }
+}
+
+sub debarch_to_multiarch($)
+{
+ my ($arch) = @_;
+
+ return gnutriplet_to_multiarch(debarch_to_gnutriplet($arc h));
+}
+
+sub multiarch_to_debarch($)
+{
+ my ($ma) = @_;
+
+ return gnutriplet_to_debarch(multiarch_to_gnutriplet($ma) );
+}
+
sub debtriplet_to_debarch(@)
{
read_triplettable() if (!%debtriplet_to_debarch);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 40b680e..e030827 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::ErrorHandling;
use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
debarch_to_cpuattrs
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
- debarch_to_gnutriplet gnutriplet_to_debarch);
+ debarch_to_gnutriplet gnutriplet_to_debarch
+ debarch_to_multiarch);

textdomain("dpkg-dev");

@@ -127,9 +128,11 @@ my %v;
my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_MULTIARCH
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
- DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE
+ DEB_HOST_MULTIARCH);

$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
@@ -190,6 +193,9 @@ my $abi;
($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});

+$v{DEB_BUILD_MULTIARCH} = debarch_to_multiarch($v{DEB_BUILD_ARCH});
+$v{DEB_HOST_MULTIARCH} = debarch_to_multiarch($v{DEB_HOST_ARCH});
+
for my $k (@ordered) {
$v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
}
--
1.7.1


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1299624812-3819-2-git-send-email-steve.langasek@linaro.org">http://lists.debian.org/1299624812-3819-2-git-send-email-steve.langasek@linaro.org
 
Old 03-08-2011, 09:57 PM
Jonathan Nieder
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Steve Langasek wrote:

> Add new variables that return the "ideal" GNU triplet for each architecture
> which should be used as the path component for library installation.

Neat! I like it (FWIW I think multiarch tuples are about as good for
this purpose, too).

> +++ b/scripts/Dpkg/Arch.pm
[...]
> @@ -195,6 +200,25 @@ sub read_triplettable()
> close TRIPLETTABLE;
> }
>
> +sub read_multiarchtable()
> +{
> + local $_;
> + local $/ = "
";
> +
> + open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
> + or syserr(_g("cannot open %s"), "multiarchtable");

Where does this file come from?


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110308225713.GH26471@elie">http://lists.debian.org/20110308225713.GH26471@elie
 
Old 03-08-2011, 10:08 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

On Tue, Mar 08, 2011 at 04:57:13PM -0600, Jonathan Nieder wrote:
> Steve Langasek wrote:

> > Add new variables that return the "ideal" GNU triplet for each architecture
> > which should be used as the path component for library installation.

> Neat! I like it (FWIW I think multiarch tuples are about as good for
> this purpose, too).

> > +++ b/scripts/Dpkg/Arch.pm
> [...]
> > @@ -195,6 +200,25 @@ sub read_triplettable()
> > close TRIPLETTABLE;
> > }
> >
> > +sub read_multiarchtable()
> > +{
> > + local $_;
> > + local $/ = "
";
> > +
> > + open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
> > + or syserr(_g("cannot open %s"), "multiarchtable");

> Where does this file come from?

... from the third attempt to send the patch. Sorry, there was meant to be
explanatory text in the mail explaining my screw-up, but apparently git
send-email permitted me to screw that up as well.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 03-08-2011, 10:11 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Add new variables that return the "ideal" GNU triplet for each architecture
which should be used as the path component for library installation.
---
Makefile.am | 2 +-
debian/changelog | 5 +++
man/dpkg-architecture.1 | 6 ++++
multiarchtable | 4 ++
scripts/Dpkg/Arch.pm | 66 +++++++++++++++++++++++++++++++++++++++++-
scripts/dpkg-architecture.pl | 10 +++++-
6 files changed, 89 insertions(+), 4 deletions(-)
create mode 100644 multiarchtable

diff --git a/Makefile.am b/Makefile.am
index f1561ef..2f4b55e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ SUBDIRS =
ACLOCAL_AMFLAGS = -I m4


-dist_pkgdata_DATA = cputable ostable triplettable
+dist_pkgdata_DATA = cputable ostable triplettable multiarchtable

EXTRA_DIST =
.mailmap
diff --git a/debian/changelog b/debian/changelog
index 9f23d32..5cbb06f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,11 @@ dpkg (1.16.0) UNRELEASED; urgency=low
[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

+ [ Steve Langasek ]
+ * add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH, that
+ return the "ideal" GNU triplet for each architecture which should be
+ used as the path component for library installation.
+
-- Guillem Jover <guillem@debian.org> Thu, 29 Jul 2010 11:00:22 +0200

dpkg (1.15.8.10) unstable; urgency=low
diff --git a/man/dpkg-architecture.1 b/man/dpkg-architecture.1
index 4ca309e..3176d1b 100644
--- a/man/dpkg-architecture.1
+++ b/man/dpkg-architecture.1
@@ -115,6 +115,9 @@ The s-1CPUs0 part of s-1DEB_BUILD_GNU_TYPEs0.
The System part of s-1DEB_BUILD_GNU_TYPEs0.
.IP "s-1DEB_BUILD_GNU_TYPEs0" 4
The s-1GNUs0 system type of the build machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the build machine, used for filesystem
+paths.
.IP "s-1DEB_HOST_ARCHs0" 4
The Debian architecture of the host machine.
.IP "s-1DEB_HOST_ARCH_OSs0" 4
@@ -131,6 +134,9 @@ The s-1CPUs0 part of s-1DEB_HOST_GNU_TYPEs0.
The System part of s-1DEB_HOST_GNU_TYPEs0.
.IP "s-1DEB_HOST_GNU_TYPEs0" 4
The s-1GNUs0 system type of the host machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the host machine, used for filesystem
+paths.
.
.SH "DEBIAN/RULES"
The environment variables set by fBdpkg-architecturefP are passed to
diff --git a/multiarchtable b/multiarchtable
new file mode 100644
index 0000000..031879b
--- /dev/null
+++ b/multiarchtable
@@ -0,0 +1,4 @@
+# Bidirectional mapping between a GNU triplet and a Multiarch triplet.
+#
+# <GNU triplet> <Multiarch triplet>
+i486-linux-gnu i386-linux-gnu
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index da72345..20d7346 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -25,7 +25,9 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ gnutriplet_to_multiarch multiarch_to_gnutriplet
+ debarch_to_multiarch multiarch_to_debarch);

use Dpkg;
use Dpkg::Gettext;
@@ -39,6 +41,9 @@ my (%cpubits, %cpuendian);
my %debtriplet_to_debarch;
my %debarch_to_debtriplet;

+my %gnutriplet_to_matriplet;
+my %matriplet_to_gnutriplet;
+
{
my $build_arch;
my $host_arch;
@@ -195,6 +200,25 @@ sub read_triplettable()
close TRIPLETTABLE;
}

+sub read_multiarchtable()
+{
+ local $_;
+ local $/ = "
";
+
+ open MULTIARCHTABLE, "$pkgdatadir/multiarchtable"
+ or syserr(_g("cannot open %s"), "multiarchtable");
+ while (<MULTIARCHTABLE>) {
+ if (m/^(?!#)(S+)s+(S+)/) {
+ my $gnutriplet = $1;
+ my $matriplet = $2;
+
+ $matriplet_to_gnutriplet{$2} = $1;
+ $gnutriplet_to_matriplet{$1} = $2;
+ }
+ }
+ close MULTIARCHTABLE;
+}
+
sub debtriplet_to_gnutriplet(@)
{
read_cputable() if (!@cpu);
@@ -237,6 +261,46 @@ sub gnutriplet_to_debtriplet($)
return (split(/-/, $os, 2), $cpu);
}

+sub gnutriplet_to_multiarch($)
+{
+ read_multiarchtable() if (!%gnutriplet_to_matriplet);
+
+ my ($gnu) = @_;
+
+ if (exists $gnutriplet_to_matriplet{"$gnu"}) {
+ return $gnutriplet_to_matriplet{"$gnu"};
+ } else {
+ return $gnu;
+ }
+}
+
+sub multiarch_to_gnutriplet($)
+{
+ read_multiarchtable() if (!%matriplet_to_gnutriplet);
+
+ my ($multi) = @_;
+
+ if (exists $matriplet_to_gnutriplet{"$multi"}) {
+ return $matriplet_to_gnutriplet{"$multi"};
+ } else {
+ return $multi;
+ }
+}
+
+sub debarch_to_multiarch($)
+{
+ my ($arch) = @_;
+
+ return gnutriplet_to_multiarch(debarch_to_gnutriplet($arc h));
+}
+
+sub multiarch_to_debarch($)
+{
+ my ($ma) = @_;
+
+ return gnutriplet_to_debarch(multiarch_to_gnutriplet($ma) );
+}
+
sub debtriplet_to_debarch(@)
{
read_triplettable() if (!%debtriplet_to_debarch);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 40b680e..e030827 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::ErrorHandling;
use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
debarch_to_cpuattrs
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
- debarch_to_gnutriplet gnutriplet_to_debarch);
+ debarch_to_gnutriplet gnutriplet_to_debarch
+ debarch_to_multiarch);

textdomain("dpkg-dev");

@@ -127,9 +128,11 @@ my %v;
my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_MULTIARCH
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
- DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE
+ DEB_HOST_MULTIARCH);

$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
@@ -190,6 +193,9 @@ my $abi;
($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});

+$v{DEB_BUILD_MULTIARCH} = debarch_to_multiarch($v{DEB_BUILD_ARCH});
+$v{DEB_HOST_MULTIARCH} = debarch_to_multiarch($v{DEB_HOST_ARCH});
+
for my $k (@ordered) {
$v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
}
--
1.7.1


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1299625870-4604-1-git-send-email-steve.langasek@linaro.org">http://lists.debian.org/1299625870-4604-1-git-send-email-steve.langasek@linaro.org
 
Old 03-09-2011, 01:47 AM
Guillem Jover
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Hi!

On Tue, 2011-03-08 at 15:11:10 -0800, Steve Langasek wrote:
> Add new variables that return the "ideal" GNU triplet for each architecture
> which should be used as the path component for library installation.

> diff --git a/multiarchtable b/multiarchtable
> new file mode 100644
> index 0000000..031879b
> --- /dev/null
> +++ b/multiarchtable
> @@ -0,0 +1,4 @@
> +# Bidirectional mapping between a GNU triplet and a Multiarch triplet.
> +#
> +# <GNU triplet> <Multiarch triplet>
> +i486-linux-gnu i386-linux-gnu

This has the slight problem of needing to be diverged for Ubuntu and
other derivatives where the baseline triplet is different from Debian.

So I guess this would need either the corresponding fixup in
debian/rules, or maybe better to use a regex for the GNU triplet,
although then the bi-direction mapping becomes a bit more cumbersome,
but I don't think we need it right now anyway?

thanks,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110309024700.GA795@gaara.hadrons.org">http://lists.debian.org/20110309024700.GA795@gaara.hadrons.org
 
Old 03-09-2011, 02:04 AM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

On Wed, Mar 09, 2011 at 03:47:00AM +0100, Guillem Jover wrote:

> On Tue, 2011-03-08 at 15:11:10 -0800, Steve Langasek wrote:
> > Add new variables that return the "ideal" GNU triplet for each architecture
> > which should be used as the path component for library installation.

> > diff --git a/multiarchtable b/multiarchtable
> > new file mode 100644
> > index 0000000..031879b
> > --- /dev/null
> > +++ b/multiarchtable
> > @@ -0,0 +1,4 @@
> > +# Bidirectional mapping between a GNU triplet and a Multiarch triplet.
> > +#
> > +# <GNU triplet> <Multiarch triplet>
> > +i486-linux-gnu i386-linux-gnu

> This has the slight problem of needing to be diverged for Ubuntu and
> other derivatives where the baseline triplet is different from Debian.

Yep.

> So I guess this would need either the corresponding fixup in
> debian/rules,

Ah, yes; hadn't realized that this was being done via debian/rules, I guess
it would have had to be since dpkg was otherwise in sync between Debian and
Ubuntu. I can add this.

> or maybe better to use a regex for the GNU triplet, although then the
> bi-direction mapping becomes a bit more cumbersome, but I don't think we
> need it right now anyway?

... or I can drop the bi-directional mapping, too, whichever you prefer. I
agree that there's no strong need for it, I was just following the model of
the existing code.

I don't think it's worth doing this with regex, though; I would just add
multiple entries to the table.

BTW, I've just noticed that the !linux i386 architectures also need to be
added to this table; sorry about that. I can clean that up at the same time
as fixing the above issue, however you recommend it be fixed.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 03-09-2011, 02:48 AM
Guillem Jover
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

On Tue, 2011-03-08 at 19:04:16 -0800, Steve Langasek wrote:
> On Wed, Mar 09, 2011 at 03:47:00AM +0100, Guillem Jover wrote:
> > So I guess this would need either the corresponding fixup in
> > debian/rules,
>
> Ah, yes; hadn't realized that this was being done via debian/rules, I guess
> it would have had to be since dpkg was otherwise in sync between Debian and
> Ubuntu. I can add this.

My hope is to be able to eventually remove that code in the future
somehow.

> > or maybe better to use a regex for the GNU triplet, although then the
> > bi-direction mapping becomes a bit more cumbersome, but I don't think we
> > need it right now anyway?
>
> ... or I can drop the bi-directional mapping, too, whichever you prefer. I
> agree that there's no strong need for it, I was just following the model of
> the existing code.
>
> I don't think it's worth doing this with regex, though; I would just add
> multiple entries to the table.

Well it's probably more future proof, but I don't think I really mind
either way (regex or explicit list).

> BTW, I've just noticed that the !linux i386 architectures also need to be
> added to this table; sorry about that. I can clean that up at the same time
> as fixing the above issue, however you recommend it be fixed.

Oh right! How annoying.

Hmm, or maybe given that the only current exception is i386, we are just
better off handling it directly in the function, we can always move to
a table or whatever if there happens to be more special casing in the
future (which I doubt?).

thanks,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110309034813.GA1275@gaara.hadrons.org">http://lists.debian.org/20110309034813.GA1275@gaara.hadrons.org
 
Old 03-09-2011, 06:43 PM
Steve Langasek
 
Default Add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH

Ok, here's an updated version of the patch:
- drops the bidirectionality assumption (lets us handle both i486 and i686
in a single implementation)
- drops the table in favor of a simple in-lined implementation.

For my part I don't yet see a consensus around a single triplet that armhf
will be able to use as both GNU triplet and multiarch triplet, so I think
there's still a possibility that armhf will need to be added here as well;
but we can certainly cross that bridge when we come to it, as armhf support
hasn't yet landed in dpkg at all.

Can this patch be queued for dpkg 1.16.0? It would be good to have this
land in the archive ASAP, so that we can start patching the other libraries
(dpkg multi-arch: same support is not a prerequisite for that).


Add new variables that return the "ideal" GNU triplet for each architecture
which should be used as the path component for library installation.
---
debian/changelog | 5 +++++
man/dpkg-architecture.1 | 6 ++++++
scripts/Dpkg/Arch.pm | 22 +++++++++++++++++++++-
scripts/dpkg-architecture.pl | 10 ++++++++--
4 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9f23d32..5cbb06f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,11 @@ dpkg (1.16.0) UNRELEASED; urgency=low
[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

+ [ Steve Langasek ]
+ * add new variables, DEB_HOST_MULTIARCH and DEB_BUILD_MULTIARCH, that
+ return the "ideal" GNU triplet for each architecture which should be
+ used as the path component for library installation.
+
-- Guillem Jover <guillem@debian.org> Thu, 29 Jul 2010 11:00:22 +0200

dpkg (1.15.8.10) unstable; urgency=low
diff --git a/man/dpkg-architecture.1 b/man/dpkg-architecture.1
index 4ca309e..3176d1b 100644
--- a/man/dpkg-architecture.1
+++ b/man/dpkg-architecture.1
@@ -115,6 +115,9 @@ The s-1CPUs0 part of s-1DEB_BUILD_GNU_TYPEs0.
The System part of s-1DEB_BUILD_GNU_TYPEs0.
.IP "s-1DEB_BUILD_GNU_TYPEs0" 4
The s-1GNUs0 system type of the build machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the build machine, used for filesystem
+paths.
.IP "s-1DEB_HOST_ARCHs0" 4
The Debian architecture of the host machine.
.IP "s-1DEB_HOST_ARCH_OSs0" 4
@@ -131,6 +134,9 @@ The s-1CPUs0 part of s-1DEB_HOST_GNU_TYPEs0.
The System part of s-1DEB_HOST_GNU_TYPEs0.
.IP "s-1DEB_HOST_GNU_TYPEs0" 4
The s-1GNUs0 system type of the host machine.
+.IP "s-1DEB_BUILD_MULTIARCHs0" 4
+The clarified s-1GNUs0 system type of the host machine, used for filesystem
+paths.
.
.SH "DEBIAN/RULES"
The environment variables set by fBdpkg-architecturefP are passed to
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index da72345..df02ace 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -25,7 +25,8 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
debarch_to_cpuattrs
debarch_to_gnutriplet gnutriplet_to_debarch
debtriplet_to_gnutriplet gnutriplet_to_debtriplet
- debtriplet_to_debarch debarch_to_debtriplet);
+ debtriplet_to_debarch debarch_to_debtriplet
+ gnutriplet_to_multiarch debarch_to_multiarch);

use Dpkg;
use Dpkg::Gettext;
@@ -237,6 +238,25 @@ sub gnutriplet_to_debtriplet($)
return (split(/-/, $os, 2), $cpu);
}

+sub gnutriplet_to_multiarch($)
+{
+ my ($gnu) = @_;
+ my ($cpu,$cdr) = split('-',$gnu,2);
+
+ if ($cpu =~ /^i[456]86$/) {
+ return "i386-$cdr";
+ } else {
+ return $gnu;
+ }
+}
+
+sub debarch_to_multiarch($)
+{
+ my ($arch) = @_;
+
+ return gnutriplet_to_multiarch(debarch_to_gnutriplet($arc h));
+}
+
sub debtriplet_to_debarch(@)
{
read_triplettable() if (!%debtriplet_to_debarch);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 40b680e..e030827 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::ErrorHandling;
use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type
debarch_to_cpuattrs
get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
- debarch_to_gnutriplet gnutriplet_to_debarch);
+ debarch_to_gnutriplet gnutriplet_to_debarch
+ debarch_to_multiarch);

textdomain("dpkg-dev");

@@ -127,9 +128,11 @@ my %v;
my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
+ DEB_BUILD_MULTIARCH
DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
- DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
+ DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE
+ DEB_HOST_MULTIARCH);

$v{DEB_BUILD_ARCH} = get_raw_build_arch();
$v{DEB_BUILD_GNU_TYPE} = debarch_to_gnutriplet($v{DEB_BUILD_ARCH});
@@ -190,6 +193,9 @@ my $abi;
($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});

+$v{DEB_BUILD_MULTIARCH} = debarch_to_multiarch($v{DEB_BUILD_ARCH});
+$v{DEB_HOST_MULTIARCH} = debarch_to_multiarch($v{DEB_HOST_ARCH});
+
for my $k (@ordered) {
$v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
}
--
1.7.1


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1299699785-4576-1-git-send-email-steve.langasek@linaro.org">http://lists.debian.org/1299699785-4576-1-git-send-email-steve.langasek@linaro.org
 

Thread Tools




All times are GMT. The time now is 10:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org