--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: dpkg-cross: [Patch] Check dpkg-architecture before falling back to internal tables
- From: Ron <ron@debian.org>
- Date: Mon, 25 Jun 2007 17:21:24 +0930
- Message-id: <20070625075124.2132.85363.reportbug@homer.shelbyville.oz>
Package: dpkg-cross
Version: 1.38
Severity: normal
Hi,
Please apply the following patch, it queries dpkg-architecture before
falling back to %archtable and %crossprefixtable entries. I have
removed all entries from %archtable that simply reproduce what current
dpkg outputs, and flagged with #XXX those which actually output
something different. Those should probably be removed too, but I'll
leave that decision to others, they may indicate changes that also
need to be made elsewhere. The remaining few in %archtable are unique
to dpkg-cross and not recognised by dpkg.
Everything else should be fairly self evident, but bug me back if it
needs fixing or justifying further.
Cheers,
Ron
---
dpkg-cross.pl | 48 +++++++++++++++++++-----------------------------
1 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/dpkg-cross.pl b/dpkg-cross.pl
index 134f783..0f63715 100644
--- a/dpkg-cross.pl
+++ b/dpkg-cross.pl
@@ -44,36 +44,18 @@ foreach my $var_ ( @intern_vars ) {
$DPKGCROSSVERSION = "1.38";
# Convertion table for Debian GNU/Linux architecture name (``$arch'') to GNU
-# type.
+# type. This lists additional arch names that are not already supported by
+# dpkg-architecture.
%archtable = (
- 'i386' => 'i486-linux-gnu',
- 'sparc' => 'sparc-linux-gnu',
'sparc64' => 'sparc-linux-gnu',
- 'alpha' => 'alpha-linux-gnu',
- 'm68k' => 'm68k-linux-gnu',
- 'arm' => 'arm-linux-gnu',
- 'armeb' => 'armeb-linux-gnueabi',
- 'armel' => 'arm-linux-gnueabi',
- 'powerpc' => 'powerpc-linux-gnu',
+ 'armeb' => 'armeb-linux-gnueabi', #XXX This differs from dpkg-architecture
'ppc' => 'powerpc-linux-gnu',
- 'mips' => 'mips-linux-gnu',
- 'mipsel' => 'mipsel-linux-gnu',
- 'sh3' => 'sh3-linux-gnu',
- 'sh4' => 'sh4-linux-gnu',
- 'sh3eb' => 'sh3eb-linux-gnu',
- 'sh4eb' => 'sh4eb-linux-gnu',
- 'hppa' => 'hppa-linux-gnu',
- 'hurd-i386' => 'i386-gnu',
- 's390' => 's390-linux-gnu',
- 's390x' => 's390-linux-gnu',
- 'ia64' => 'ia64-linux-gnu',
- 'm32r' => 'm32r-linux-gnu',
- 'openbsd-i386' => 'i386-openbsd',
- 'freebsd-i386' => 'i386-freebsd',
- 'darwin-powerpc' => 'powerpc-darwin',
- 'darwin-i386' => 'i386-darwin',
- 'win32-i386' => 'i386-cygwin',
- 'amd64' => 'x86_64-linux-gnu');
+ 'hurd-i386' => 'i386-gnu', #XXX This differs from dpkg-architecture
+ 's390x' => 's390-linux-gnu', #XXX This differs from dpkg-architecture
+ 'openbsd-i386' => 'i386-openbsd', #XXX This differs from dpkg-architecture
+ 'freebsd-i386' => 'i386-freebsd', #XXX This differs from dpkg-architecture
+ 'darwin-i386' => 'i386-darwin', #XXX This differs from dpkg-architecture
+ 'win32-i386' => 'i386-cygwin');
# Regexps to parse 'file' output to detect arch of ELF binary
# Note that it is not always possibe to restore Debian architecture
@@ -275,8 +257,10 @@ sub setup {
# Set ``$arch'' to defaults if not already specified.
$arch = get_architecture();
die "$progname: Architecture is not specified.\n" unless ($arch);
- $deb_host_gnu_type = $archtable{$arch}; # FIXME: should use dpkg-architecture here
-
+
+ chomp($deb_host_gnu_type = `dpkg-architecture -a$arch -qDEB_HOST_GNU_TYPE 2> /dev/null`);
+ $deb_host_gnu_type ||= $archtable{$arch};
+
# Finalize, no subst possible crossbase.
$crossbase ||= "/usr";
@@ -443,6 +427,12 @@ sub get_tool {
return $t_ if ($t_);
}
+ my $prefix_ = `dpkg-architecture -a$arch_ -qDEB_HOST_GNU_TYPE 2> /dev/null`;
+ if( chomp($prefix_) ) {
+ my $t_ = find_in_path($prefix_ . "-" . $tool_);
+ return $t_ if ($t_);
+ }
+
if (defined($crossprefixtable{$arch_})) {
my @l_ = @{$crossprefixtable{$arch_}};
# move $crossprefix to the first place in the list
--
1.5.2.2
--- End Message ---
--- Begin Message ---
Source: dpkg-cross
Source-Version: 1.99+2.0.0pre1
We believe that the bug you reported is fixed in the latest version of
dpkg-cross, which is due to be installed in the Debian FTP archive:
dpkg-cross_1.99+2.0.0pre1.dsc
to pool/main/d/dpkg-cross/dpkg-cross_1.99+2.0.0pre1.dsc
dpkg-cross_1.99+2.0.0pre1.tar.gz
to pool/main/d/dpkg-cross/dpkg-cross_1.99+2.0.0pre1.tar.gz
dpkg-cross_1.99+2.0.0pre1_all.deb
to pool/main/d/dpkg-cross/dpkg-cross_1.99+2.0.0pre1_all.deb
libdebian-dpkgcross-perl_1.99+2.0.0pre1_all.deb
to pool/main/d/dpkg-cross/libdebian-dpkgcross-perl_1.99+2.0.0pre1_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 430507@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Neil Williams <codehelp@debian.org> (supplier of updated dpkg-cross package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Wed, 15 Aug 2007 07:20:26 +0100
Source: dpkg-cross
Binary: libdebian-dpkgcross-perl dpkg-cross
Architecture: source all
Version: 1.99+2.0.0pre1
Distribution: experimental
Urgency: low
Maintainer: Debian Embedded Group <debian-embedded@lists.debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description:
dpkg-cross - tools for cross compiling Debian packages
libdebian-dpkgcross-perl - functions to aid cross-compiling Debian packages
Closes: 72405 115247 284275 430507 437507
Changes:
dpkg-cross (1.99+2.0.0pre1) experimental; urgency=low
.
* refactoring for a 2.0.0 release.
* config.common linux specific (Closes: #72405)
* [Patch] Check dpkg-architecture before falling back to internal
tables (Closes: #430507)
* cross-config.common, cross-config.${arch_os} files (Closes: #284275)
* broken CC_FOR_BUILD handling in diverted
dpkg-buildpackage (Closes: #437507)
* Migrate to CDBS
* broken on anything but GNU/linux (Closes: #115247)
Files:
4003f80420125c96b01afa5ebbf1f377 939 utils extra dpkg-cross_1.99+2.0.0pre1.dsc
f24e1e645db311837a854e00c0816748 76454 utils extra dpkg-cross_1.99+2.0.0pre1.tar.gz
b74d1dd102a8a5011b01fe4595cc10eb 59224 utils extra dpkg-cross_1.99+2.0.0pre1_all.deb
80b79a5fd4f7f9a6682f3903e4d3becd 27082 perl extra libdebian-dpkgcross-perl_1.99+2.0.0pre1_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGy3c7iAEJSii8s+MRAvHJAKCVq9vss8DypaTi92SpymdaqOSLagCgquIi
T7Jmuy5TXT1bX32zIQ7ENfk=
=SGf5
-----END PGP SIGNATURE-----
--- End Message ---